diff --git a/include/sqlpp11/data_types/integral/expression_operators.h b/include/sqlpp11/data_types/integral/expression_operators.h index 445703b5..71e7a876 100644 --- a/include/sqlpp11/data_types/integral/expression_operators.h +++ b/include/sqlpp11/data_types/integral/expression_operators.h @@ -53,7 +53,7 @@ namespace sqlpp struct return_type_plus> { using check = consistent_t; - using type = integral; + using type = plus_t, integral, wrap_operand_t>; }; template @@ -67,7 +67,7 @@ namespace sqlpp struct return_type_minus> { using check = consistent_t; - using type = integral; + using type = minus_t, integral, wrap_operand_t>; }; template @@ -81,7 +81,7 @@ namespace sqlpp struct return_type_multiplies> { using check = consistent_t; - using type = integral; + using type = multiplies_t, integral, wrap_operand_t>; }; template @@ -95,7 +95,7 @@ namespace sqlpp struct return_type_divides> { using check = consistent_t; - using type = integral; + using type = divides_t, wrap_operand_t>; }; template diff --git a/include/sqlpp11/data_types/unsigned_integral/expression_operators.h b/include/sqlpp11/data_types/unsigned_integral/expression_operators.h index 1c016102..bb5730b7 100644 --- a/include/sqlpp11/data_types/unsigned_integral/expression_operators.h +++ b/include/sqlpp11/data_types/unsigned_integral/expression_operators.h @@ -38,7 +38,7 @@ namespace sqlpp { struct integral; - + template struct expression_operators : public basic_expression_operators { diff --git a/test_serializer/As.cpp b/test_serializer/As.cpp index 78eb5b19..76c4dcfa 100644 --- a/test_serializer/As.cpp +++ b/test_serializer/As.cpp @@ -39,8 +39,10 @@ int As(int, char* []) compare(__LINE__, foo.omega.as(cheese), "tab_foo.omega AS cheese"); compare(__LINE__, (foo.omega + 17).as(cheese), "(tab_foo.omega+17) AS cheese"); compare(__LINE__, (foo.omega - 17).as(cheese), "(tab_foo.omega-17) AS cheese"); + compare(__LINE__, (foo.omega - uint32_t(17)).as(cheese), "(tab_foo.omega-17) AS cheese"); compare(__LINE__, (foo.omega - bar.alpha).as(cheese), "(tab_foo.omega-tab_bar.alpha) AS cheese"); compare(__LINE__, (count(foo.omega) - bar.alpha).as(cheese), "(COUNT(tab_foo.omega)-tab_bar.alpha) AS cheese"); + compare(__LINE__, (count(foo.omega) - uint32_t(17)).as(cheese), "(COUNT(tab_foo.omega)-17) AS cheese"); return 0; } diff --git a/test_serializer/CMakeLists.txt b/test_serializer/CMakeLists.txt index f7f38f91..07add5a0 100644 --- a/test_serializer/CMakeLists.txt +++ b/test_serializer/CMakeLists.txt @@ -28,8 +28,8 @@ set(test_serializer_names From In Insert - Where TableAlias + Where ) create_test_sourcelist(test_serializer_sources test_serializer_main.cpp ${test_serializer_names}) diff --git a/tests/SelectType.cpp b/tests/SelectType.cpp index 9dc7d845..f0781007 100644 --- a/tests/SelectType.cpp +++ b/tests/SelectType.cpp @@ -167,7 +167,8 @@ int SelectType(int, char* []) static_assert(sqlpp::is_integral_t>::value, "type requirement"); static_assert(sqlpp::is_integral_t>::value, "type requirement"); static_assert(sqlpp::is_integral_t>::value, "type requirement"); - static_assert(sqlpp::is_integral_t>::value, "type requirement"); + static_assert(sqlpp::is_floating_point_t>::value, + "type requirement"); static_assert(sqlpp::is_integral_t>::value, "type requirement"); }