diff --git a/include/sqlpp11/basic_expression_operators.h b/include/sqlpp11/basic_expression_operators.h index 4601dff7..098c065e 100644 --- a/include/sqlpp11/basic_expression_operators.h +++ b/include/sqlpp11/basic_expression_operators.h @@ -41,23 +41,28 @@ namespace sqlpp { - SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_valid_rhs_operand_t, "invalid rhs operand in comparison"); - SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_lhs_rhs_differ_t, "identical lhs and rhs operand types in comparison"); + 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_rhs_comparison_operand_t = static_combined_check_t< - static_check_t<(is_expression_t>::value // expressions are OK - or - is_multi_expression_t>::value) // multi-expressions like ANY are - // OK for comparisons, too - and - value_type_of::template _is_valid_operand< - sqlpp::wrap_operand_t>::value, // the correct value type is required, of course - assert_comparison_valid_rhs_operand_t>, + using check_comparison_t = 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_rhs_in_arguments_t = static_combined_check_t...>; + template + using check_in_t = static_combined_check_t< + static_check_t>::value...>::value, + assert_comparison_rhs_is_expression_t>, + static_check_t::template _is_valid_operand< + sqlpp::wrap_operand_t>::value...>::value, + assert_comparison_rhs_is_valid_operand_t>, + static_check_t::value...>::value, + assert_comparison_lhs_rhs_differ_t>>; namespace detail { @@ -100,10 +105,8 @@ namespace sqlpp template