mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-03 11:40:39 -06:00
Fixed result types for signed OP unsigned expressions.
This commit is contained in:
@@ -53,7 +53,7 @@ namespace sqlpp
|
||||
struct return_type_plus<L, R, binary_operand_check_t<L, is_integral_t, R, is_unsigned_integral_t>>
|
||||
{
|
||||
using check = consistent_t;
|
||||
using type = integral;
|
||||
using type = plus_t<wrap_operand_t<L>, integral, wrap_operand_t<R>>;
|
||||
};
|
||||
|
||||
template <typename L, typename R>
|
||||
@@ -67,7 +67,7 @@ namespace sqlpp
|
||||
struct return_type_minus<L, R, binary_operand_check_t<L, is_integral_t, R, is_unsigned_integral_t>>
|
||||
{
|
||||
using check = consistent_t;
|
||||
using type = integral;
|
||||
using type = minus_t<wrap_operand_t<L>, integral, wrap_operand_t<R>>;
|
||||
};
|
||||
|
||||
template <typename L, typename R>
|
||||
@@ -81,7 +81,7 @@ namespace sqlpp
|
||||
struct return_type_multiplies<L, R, binary_operand_check_t<L, is_integral_t, R, is_unsigned_integral_t>>
|
||||
{
|
||||
using check = consistent_t;
|
||||
using type = integral;
|
||||
using type = multiplies_t<wrap_operand_t<L>, integral, wrap_operand_t<R>>;
|
||||
};
|
||||
|
||||
template <typename L, typename R>
|
||||
@@ -95,7 +95,7 @@ namespace sqlpp
|
||||
struct return_type_divides<L, R, binary_operand_check_t<L, is_integral_t, R, is_unsigned_integral_t>>
|
||||
{
|
||||
using check = consistent_t;
|
||||
using type = integral;
|
||||
using type = divides_t<wrap_operand_t<L>, wrap_operand_t<R>>;
|
||||
};
|
||||
|
||||
template <typename L, typename R>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
namespace sqlpp
|
||||
{
|
||||
struct integral;
|
||||
|
||||
|
||||
template <typename Expression>
|
||||
struct expression_operators<Expression, unsigned_integral> : public basic_expression_operators<Expression>
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -167,7 +167,8 @@ int SelectType(int, char* [])
|
||||
static_assert(sqlpp::is_integral_t<sqlpp::return_type_minus_t<sqlpp::integral, T>>::value, "type requirement");
|
||||
static_assert(sqlpp::is_integral_t<sqlpp::return_type_plus_t<sqlpp::integral, T>>::value, "type requirement");
|
||||
static_assert(sqlpp::is_integral_t<sqlpp::return_type_multiplies_t<sqlpp::integral, T>>::value, "type requirement");
|
||||
static_assert(sqlpp::is_integral_t<sqlpp::return_type_divides_t<sqlpp::integral, T>>::value, "type requirement");
|
||||
static_assert(sqlpp::is_floating_point_t<sqlpp::return_type_divides_t<sqlpp::integral, T>>::value,
|
||||
"type requirement");
|
||||
static_assert(sqlpp::is_integral_t<sqlpp::return_type_modulus_t<sqlpp::integral, T>>::value, "type requirement");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user