/* * Copyright (c) 2013-2016, Roland Bock * Copyright (c) 2016, Aaron Bishop * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef SQLPP_DETAIL_BASIC_EXPRESSION_OPERATORS_H #define SQLPP_DETAIL_BASIC_EXPRESSION_OPERATORS_H #include #include #include #include #include #include #include #include #include #include #include #include namespace sqlpp { SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_rhs_is_expression_t, "rhs operand in comparison is not an expression"); SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_rhs_is_valid_operand_t, "invalid rhs operand in comparison"); SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_lhs_rhs_differ_t, "identical lhs and rhs operands in comparison"); template using check_comparison_impl = static_combined_check_t< static_check_t::value, is_multi_expression_t::value>::value, assert_comparison_rhs_is_expression_t>, static_check_t::template _is_valid_operand::value, assert_comparison_rhs_is_valid_operand_t>, static_check_t::value, assert_comparison_lhs_rhs_differ_t>>; template using check_comparison_t = check_comparison_impl>; template using check_in_impl = static_combined_check_t< static_check_t::value...>::value, assert_comparison_rhs_is_expression_t>, static_check_t::template _is_valid_operand::value...>::value, assert_comparison_rhs_is_valid_operand_t>, static_check_t::value...>::value, assert_comparison_lhs_rhs_differ_t>>; template using check_in_t = check_in_impl::type...>; namespace detail { template class Expr, typename Lhs, typename Rhs> struct comparison_expression_impl { using type = bad_expression; }; template