From 7f29a0b126d2b746359690ecaad4ac8c76175e0e Mon Sep 17 00:00:00 2001 From: rbock Date: Tue, 20 Aug 2019 18:32:16 +0200 Subject: [PATCH] Fix expressions for unsigned integral as suggested by @fraillt --- .../data_types/unsigned_integral/expression_operators.h | 8 ++++---- tests/SelectType.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/sqlpp11/data_types/unsigned_integral/expression_operators.h b/include/sqlpp11/data_types/unsigned_integral/expression_operators.h index b72ce3cb..49f2a2f4 100644 --- a/include/sqlpp11/data_types/unsigned_integral/expression_operators.h +++ b/include/sqlpp11/data_types/unsigned_integral/expression_operators.h @@ -48,14 +48,14 @@ namespace sqlpp struct return_type_plus> { using check = consistent_t; - using type = value_type_of>; + using type = plus_t, value_type_of>, wrap_operand_t>; }; template struct return_type_minus> { using check = consistent_t; - using type = value_type_of>; + using type = minus_t, value_type_of>, wrap_operand_t>; }; template @@ -69,14 +69,14 @@ namespace sqlpp struct return_type_multiplies> { using check = consistent_t; - using type = value_type_of>; + using type = multiplies_t, value_type_of>, wrap_operand_t>; }; template struct return_type_divides> { using check = consistent_t; - using type = value_type_of>; + using type = divides_t, wrap_operand_t>; }; template diff --git a/tests/SelectType.cpp b/tests/SelectType.cpp index f783ce15..e98febbb 100644 --- a/tests/SelectType.cpp +++ b/tests/SelectType.cpp @@ -39,9 +39,9 @@ namespace alias SQLPP_ALIAS_PROVIDER(b) SQLPP_ALIAS_PROVIDER(left) SQLPP_ALIAS_PROVIDER(right) -} +} // namespace alias -int SelectType(int, char* []) +int SelectType(int, char*[]) { MockDb db = {}; MockDb::_serializer_context_t printer = {}; @@ -163,7 +163,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"); static_assert(sqlpp::is_integral_t>::value, "type requirement"); static_assert(sqlpp::is_integral_t>::value, "type requirement");