From 5f4a88c7cee20c4e3960e606a1ea6787b47dc048 Mon Sep 17 00:00:00 2001 From: rbock Date: Fri, 16 May 2014 09:18:08 +0200 Subject: [PATCH] Function tests compile again --- include/sqlpp11/any.h | 1 + include/sqlpp11/select.h | 31 +++++++++------- include/sqlpp11/type_traits.h | 26 ++++++++------ include/sqlpp11/vendor/assignment.h | 4 +-- include/sqlpp11/vendor/expression.h | 6 ++-- include/sqlpp11/vendor/expression_fwd.h | 34 +++++++++--------- include/sqlpp11/vendor/extra_tables.h | 4 +-- include/sqlpp11/vendor/field.h | 2 +- include/sqlpp11/vendor/from.h | 4 +-- include/sqlpp11/vendor/group_by.h | 6 ++-- include/sqlpp11/vendor/having.h | 4 +-- include/sqlpp11/vendor/limit.h | 18 ++++------ include/sqlpp11/vendor/offset.h | 17 ++++----- include/sqlpp11/vendor/order_by.h | 16 ++++----- include/sqlpp11/vendor/select_column_list.h | 39 +++++++++------------ include/sqlpp11/vendor/select_flag_list.h | 15 ++++---- include/sqlpp11/vendor/where.h | 23 +++++------- tests/FunctionTest.cpp | 7 ++-- 18 files changed, 120 insertions(+), 137 deletions(-) diff --git a/include/sqlpp11/any.h b/include/sqlpp11/any.h index f7d8ec0c..b4897b6a 100644 --- a/include/sqlpp11/any.h +++ b/include/sqlpp11/any.h @@ -87,6 +87,7 @@ namespace sqlpp { static_assert(is_select_t>::value, "any() requires a select expression as argument"); static_assert(is_expression_t>::value, "any() requires a single column select expression as argument"); + // FIXME: can we accept non-values like NULL here? return { t }; } diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index fd1b3a59..66eafd90 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -112,27 +112,27 @@ namespace sqlpp static_assert(is_noop_t::value or sqlpp::is_select_column_list_t::value, "column list of select is neither naught nor a valid column list"); static_assert(is_noop_t::value or sqlpp::is_from_t::value, "from() part of select is neither naught nor a valid from()"); - using _known_tables = detail::make_joined_set_t; + using _known_tables = detail::make_joined_set_t, provided_tables_of<_extra_tables_t>>; // FIXME, use provided_tables_of; template - using _no_unknown_tables = detail::is_subset_of; + using _no_unknown_tables = detail::is_subset_of, _known_tables>; using _required_tables = detail::make_joined_set_t< - typename _flag_list_t::_table_set, - typename _column_list_t::_table_set, - typename _where_t::_table_set, - typename _group_by_t::_table_set, - typename _having_t::_table_set, - typename _order_by_t::_table_set, - typename _limit_t::_table_set, - typename _offset_t::_table_set + required_tables_of<_flag_list_t>, + required_tables_of<_column_list_t>, + required_tables_of<_where_t>, + required_tables_of<_group_by_t>, + required_tables_of<_having_t>, + required_tables_of<_order_by_t>, + required_tables_of<_limit_t>, + required_tables_of<_offset_t> >; // The tables not covered by the from. using _table_set = detail::make_difference_set_t< _required_tables, - typename _from_t::_table_set // Hint: extra_tables_t is not used here because it is just a helper for dynamic .add_*() methods and should not change the structural integrity + provided_tables_of<_from_t> // Hint: extra_tables_t is not used here because it is just a helper for dynamic .add_*() methods and should not change the structural integrity >; // A select can be used as a pseudo table if @@ -145,10 +145,12 @@ namespace sqlpp >::type; using _value_type = typename std::conditional< - is_select_column_list_t<_column_list_t>::value and is_subset_of::value, - typename ColumnList::_value_type, + is_select_column_list_t<_column_list_t>::value and is_subset_of, provided_tables_of<_from_t>>::value, + value_type_of<_column_list_t>, no_value_t // If something is selected that requires a table, then we require a from for this to be a value >::type; + + using _traits = make_traits<_value_type>; }; } @@ -160,6 +162,9 @@ namespace sqlpp public detail::select_policies_t::_value_type::template expression_operators>, public detail::select_policies_t::_methods_t { + using _traits = make_traits>, ::sqlpp::tag::select>; + using _recursive_traits = make_recursive_traits<>; // FIXME + using _policies_t = typename detail::select_policies_t; using _database_t = typename _policies_t::_database_t; using _flag_list_t = typename _policies_t::_flag_list_t; diff --git a/include/sqlpp11/type_traits.h b/include/sqlpp11/type_traits.h index 795e0407..fe2c901d 100644 --- a/include/sqlpp11/type_traits.h +++ b/include/sqlpp11/type_traits.h @@ -114,6 +114,7 @@ namespace sqlpp SQLPP_IS_VALUE_TRAIT_GENERATOR(select_flag_list); SQLPP_IS_VALUE_TRAIT_GENERATOR(select_column_list); SQLPP_IS_VALUE_TRAIT_GENERATOR(from); + SQLPP_IS_VALUE_TRAIT_GENERATOR(extra_tables); SQLPP_IS_VALUE_TRAIT_GENERATOR(on); SQLPP_IS_VALUE_TRAIT_GENERATOR(dynamic); SQLPP_IS_VALUE_TRAIT_GENERATOR(where); @@ -142,17 +143,6 @@ namespace sqlpp template class IsTag> using copy_type_trait = typename std::conditional::value, std::true_type, std::false_type>::type; - template - struct make_traits - { - using _value_type = ValueType; - using _tags = detail::make_type_set_t; - }; - template - struct make_recursive_traits - { - }; - namespace detail { template @@ -181,6 +171,20 @@ namespace sqlpp template using provided_tables_of = typename detail::provided_table_of_impl::type; + + template + struct make_traits + { + using _value_type = ValueType; + using _tags = detail::make_type_set_t; + }; + template + struct make_recursive_traits + { + using _required_tables = detail::make_joined_set_t...>; + using _provided_tables = detail::make_joined_set_t...>; + }; + } #endif diff --git a/include/sqlpp11/vendor/assignment.h b/include/sqlpp11/vendor/assignment.h index 8026a3e1..52ad3c75 100644 --- a/include/sqlpp11/vendor/assignment.h +++ b/include/sqlpp11/vendor/assignment.h @@ -65,7 +65,7 @@ namespace sqlpp template struct assignment_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits; using _column_t = Lhs; @@ -115,7 +115,7 @@ namespace sqlpp template struct assignment_t> { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits; using _column_t = Lhs; diff --git a/include/sqlpp11/vendor/expression.h b/include/sqlpp11/vendor/expression.h index b3c6075a..03c89cba 100644 --- a/include/sqlpp11/vendor/expression.h +++ b/include/sqlpp11/vendor/expression.h @@ -40,7 +40,7 @@ namespace sqlpp namespace vendor { template - struct binary_expression_t: public ::sqlpp::detail::boolean::template expression_operators> + struct binary_expression_t: public ::sqlpp::detail::boolean::template expression_operators> { using _traits = make_traits; using _recursive_traits = make_recursive_traits; @@ -84,7 +84,7 @@ namespace sqlpp }; template - struct binary_expression_t: public ::sqlpp::detail::boolean::template expression_operators> + struct binary_expression_t: public ::sqlpp::detail::boolean::template expression_operators> { using _traits = make_traits; using _recursive_traits = make_recursive_traits; @@ -128,7 +128,7 @@ namespace sqlpp }; template - struct unary_expression_t: public ::sqlpp::detail::boolean::template expression_operators> + struct unary_expression_t: public ::sqlpp::detail::boolean::template expression_operators> { using _traits = make_traits; using _recursive_traits = make_recursive_traits; diff --git a/include/sqlpp11/vendor/expression_fwd.h b/include/sqlpp11/vendor/expression_fwd.h index 66b446c5..b6529e8b 100644 --- a/include/sqlpp11/vendor/expression_fwd.h +++ b/include/sqlpp11/vendor/expression_fwd.h @@ -31,7 +31,7 @@ namespace sqlpp { namespace vendor { - namespace tag + namespace op { struct less { @@ -139,52 +139,52 @@ namespace sqlpp struct unary_expression_t; template - using less_than_t = binary_expression_t; + using less_than_t = binary_expression_t; template - using less_equal_t = binary_expression_t; + using less_equal_t = binary_expression_t; template - using equal_to_t = binary_expression_t; + using equal_to_t = binary_expression_t; template - using not_equal_to_t = binary_expression_t; + using not_equal_to_t = binary_expression_t; template - using greater_than_t = binary_expression_t; + using greater_than_t = binary_expression_t; template - using greater_equal_t = binary_expression_t; + using greater_equal_t = binary_expression_t; template - using logical_and_t = binary_expression_t; + using logical_and_t = binary_expression_t; template - using logical_or_t = binary_expression_t; + using logical_or_t = binary_expression_t; template - using plus_t = binary_expression_t, Rhs>; + using plus_t = binary_expression_t, Rhs>; template - using minus_t = binary_expression_t, Rhs>; + using minus_t = binary_expression_t, Rhs>; template - using multiplies_t = binary_expression_t, Rhs>; + using multiplies_t = binary_expression_t, Rhs>; template - using divides_t = binary_expression_t; + using divides_t = binary_expression_t; template - using modulus_t = binary_expression_t; + using modulus_t = binary_expression_t; template - using logical_not_t = unary_expression_t; + using logical_not_t = unary_expression_t; template - using unary_plus_t = unary_expression_t, Rhs>; + using unary_plus_t = unary_expression_t, Rhs>; template - using unary_minus_t = unary_expression_t, Rhs>; + using unary_minus_t = unary_expression_t, Rhs>; } } diff --git a/include/sqlpp11/vendor/extra_tables.h b/include/sqlpp11/vendor/extra_tables.h index 04e3b4d8..36fb431a 100644 --- a/include/sqlpp11/vendor/extra_tables.h +++ b/include/sqlpp11/vendor/extra_tables.h @@ -39,7 +39,7 @@ namespace sqlpp template struct extra_tables_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits; // FIXME: extra_tables must not require tables! @@ -65,7 +65,7 @@ namespace sqlpp struct no_extra_tables_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits<>; template diff --git a/include/sqlpp11/vendor/field.h b/include/sqlpp11/vendor/field.h index 2e0293bb..caf93c78 100644 --- a/include/sqlpp11/vendor/field.h +++ b/include/sqlpp11/vendor/field.h @@ -52,7 +52,7 @@ namespace sqlpp struct make_field_t_impl { using type = field_t, + value_type_of, trivial_value_is_null_t::value>; }; diff --git a/include/sqlpp11/vendor/from.h b/include/sqlpp11/vendor/from.h index 7a016cde..3e30ea33 100644 --- a/include/sqlpp11/vendor/from.h +++ b/include/sqlpp11/vendor/from.h @@ -41,7 +41,7 @@ namespace sqlpp template struct from_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits; using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; @@ -97,7 +97,7 @@ namespace sqlpp struct no_from_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits<>; template diff --git a/include/sqlpp11/vendor/group_by.h b/include/sqlpp11/vendor/group_by.h index ab023f4a..51fb4f11 100644 --- a/include/sqlpp11/vendor/group_by.h +++ b/include/sqlpp11/vendor/group_by.h @@ -43,7 +43,7 @@ namespace sqlpp template struct group_by_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits; using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; @@ -97,13 +97,13 @@ namespace sqlpp }; const group_by_t& _group_by() const { return *this; } - std::tuple _expressions; + std::tuple _expressions; vendor::interpretable_list_t _dynamic_expressions; }; struct no_group_by_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits<>; template diff --git a/include/sqlpp11/vendor/having.h b/include/sqlpp11/vendor/having.h index 8c4708e6..fa15285f 100644 --- a/include/sqlpp11/vendor/having.h +++ b/include/sqlpp11/vendor/having.h @@ -42,7 +42,7 @@ namespace sqlpp template struct having_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits; using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; @@ -98,7 +98,7 @@ namespace sqlpp struct no_having_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits<>; template diff --git a/include/sqlpp11/vendor/limit.h b/include/sqlpp11/vendor/limit.h index 15d72af1..62e94916 100644 --- a/include/sqlpp11/vendor/limit.h +++ b/include/sqlpp11/vendor/limit.h @@ -39,11 +39,10 @@ namespace sqlpp template struct limit_t { - using _is_limit = std::true_type; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits; + static_assert(is_integral_t::value, "limit requires an integral value or integral parameter"); - // FIXME: Is this really always empty? - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; limit_t(Limit value): _value(value) @@ -66,10 +65,8 @@ namespace sqlpp template struct dynamic_limit_t { - using _is_limit = std::true_type; - using _is_dynamic = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; dynamic_limit_t(): _value(noop()) @@ -108,9 +105,8 @@ namespace sqlpp struct no_limit_t { - using _is_noop = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; template struct _methods_t diff --git a/include/sqlpp11/vendor/offset.h b/include/sqlpp11/vendor/offset.h index 2a873a50..83cacd95 100644 --- a/include/sqlpp11/vendor/offset.h +++ b/include/sqlpp11/vendor/offset.h @@ -39,9 +39,9 @@ namespace sqlpp template struct offset_t { - using _is_offset = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits; + static_assert(is_integral_t::value, "offset requires an integral value or integral parameter"); offset_t(Offset value): @@ -65,10 +65,8 @@ namespace sqlpp template struct dynamic_offset_t { - using _is_offset = std::true_type; - using _is_dynamic = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; dynamic_offset_t(): _value(noop()) @@ -107,9 +105,8 @@ namespace sqlpp struct no_offset_t { - using _is_noop = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; template struct _methods_t diff --git a/include/sqlpp11/vendor/order_by.h b/include/sqlpp11/vendor/order_by.h index 80d7f891..a6d4a5ad 100644 --- a/include/sqlpp11/vendor/order_by.h +++ b/include/sqlpp11/vendor/order_by.h @@ -42,13 +42,10 @@ namespace sqlpp template struct order_by_t { - using _is_order_by = std::true_type; - using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; - using _parameter_tuple_t = std::tuple; - using _parameter_list_t = typename make_parameter_list_t<_parameter_tuple_t>::type; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits; - using _provided_tables = detail::type_set<>; - using _required_tables = typename ::sqlpp::detail::make_joined_set::type; + using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; static_assert(_is_dynamic::value or sizeof...(Expressions), "at least one sort-order expression required in order_by()"); @@ -98,15 +95,14 @@ namespace sqlpp void _add_order_by_impl(Expression expression, const std::false_type&); }; - _parameter_tuple_t _expressions; + std::tuple _expressions; vendor::interpretable_list_t _dynamic_expressions; }; struct no_order_by_t { - using _is_noop = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; template struct _methods_t diff --git a/include/sqlpp11/vendor/select_column_list.h b/include/sqlpp11/vendor/select_column_list.h index 955b4df8..1f160d16 100644 --- a/include/sqlpp11/vendor/select_column_list.h +++ b/include/sqlpp11/vendor/select_column_list.h @@ -47,14 +47,14 @@ namespace sqlpp template struct get_first_argument_if_unique { - using _value_type = no_value_t; + using _traits = make_traits; struct _name_t {}; }; template struct get_first_argument_if_unique { - using _value_type = typename T::_value_type; + using _traits = make_traits, tag::select_column_list, tag::expression, tag::named_expression>; using _name_t = typename T::_name_t; }; } @@ -132,13 +132,13 @@ namespace sqlpp template struct select_column_list_t { - using _is_select_column_list = std::true_type; - using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; - using _parameter_tuple_t = std::tuple; - using size = std::tuple_size<_parameter_tuple_t>; + // get_first_argument_if_unique is kind of ugly + using _traits = typename ::sqlpp::detail::get_first_argument_if_unique::_traits; + using _recursive_traits = make_recursive_traits; - using _provided_tables = detail::type_set<>; - using _required_tables = sqlpp::detail::make_joined_set_t; + using _name_t = typename ::sqlpp::detail::get_first_argument_if_unique::_name_t; + + using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; static_assert(not ::sqlpp::detail::has_duplicates::value, "at least one duplicate argument detected"); @@ -149,13 +149,7 @@ namespace sqlpp static_assert(not ::sqlpp::detail::has_duplicates::value, "at least one duplicate name detected"); struct _column_type {}; - struct _value_type: ::sqlpp::detail::get_first_argument_if_unique::_value_type - { - using _is_expression = typename std::conditional::type; - using _is_named_expression = typename std::conditional::type; - using _is_alias = std::false_type; - }; - using _name_t = typename ::sqlpp::detail::get_first_argument_if_unique::_name_t; + template using _result_row_t = typename std::conditional<_is_dynamic::value, @@ -186,7 +180,7 @@ namespace sqlpp static constexpr size_t static_size() { - return size::value; + return sizeof...(Columns); } template @@ -228,7 +222,7 @@ namespace sqlpp const select_column_list_t& _column_list() const { return *this; } - _parameter_tuple_t _columns; + std::tuple _columns; dynamic_select_column_list _dynamic_columns; }; } @@ -245,13 +239,12 @@ namespace sqlpp { struct no_select_column_list_t { - using _is_noop = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; + template using _result_row_t = ::sqlpp::result_row_t; using _dynamic_names_t = typename dynamic_select_column_list::_names_t; - using _value_type = no_value_t; struct _name_t {}; template @@ -293,10 +286,10 @@ namespace sqlpp static Context& _(const T& t, Context& context) { // check for at least one expression - static_assert(T::_is_dynamic::value or T::size::value, "at least one select expression required"); + static_assert(T::_is_dynamic::value or sizeof...(Columns), "at least one select expression required"); interpret_tuple(t._columns, ',', context); - if (T::size::value and not t._dynamic_columns.empty()) + if (sizeof...(Columns) and not t._dynamic_columns.empty()) context << ','; serialize(t._dynamic_columns, context); return context; diff --git a/include/sqlpp11/vendor/select_flag_list.h b/include/sqlpp11/vendor/select_flag_list.h index 889debce..85303440 100644 --- a/include/sqlpp11/vendor/select_flag_list.h +++ b/include/sqlpp11/vendor/select_flag_list.h @@ -42,12 +42,10 @@ namespace sqlpp template struct select_flag_list_t { - using _is_select_flag_list = std::true_type; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits; + using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; - using _parameter_tuple_t = std::tuple; - using size = std::tuple_size<_parameter_tuple_t>; - using _provided_tables = detail::type_set<>; - using _required_tables = typename ::sqlpp::detail::make_joined_set::type; static_assert(not ::sqlpp::detail::has_duplicates::value, "at least one duplicate argument detected in select flag list"); @@ -96,15 +94,14 @@ namespace sqlpp }; const select_flag_list_t& _flag_list() const { return *this; } - _parameter_tuple_t _flags; + std::tuple _flags; vendor::interpretable_list_t _dynamic_flags; }; struct no_select_flag_list_t { - using _is_noop = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; template struct _methods_t diff --git a/include/sqlpp11/vendor/where.h b/include/sqlpp11/vendor/where.h index 03d70ec6..01557cdd 100644 --- a/include/sqlpp11/vendor/where.h +++ b/include/sqlpp11/vendor/where.h @@ -42,19 +42,15 @@ namespace sqlpp template struct where_t { - using _is_where = std::true_type; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits; + using _is_dynamic = typename std::conditional::value, std::false_type, std::true_type>::type; - using _parameter_tuple_t = std::tuple; static_assert(_is_dynamic::value or sizeof...(Expressions), "at least one expression argument required in where()"); static_assert(sqlpp::detail::none_t::value...>::value, "at least one argument is an assignment in where()"); static_assert(sqlpp::detail::all_t::value...>::value, "at least one argument is not valid expression in where()"); - using _parameter_list_t = typename make_parameter_list_t<_parameter_tuple_t>::type; - - using _provided_tables = detail::type_set<>; - using _required_tables = typename ::sqlpp::detail::make_joined_set::type; - where_t(Expressions... expressions): _expressions(expressions...) {} @@ -97,17 +93,15 @@ namespace sqlpp void _add_where_impl(Expression expression, const std::false_type&); }; - _parameter_tuple_t _expressions; + std::tuple _expressions; vendor::interpretable_list_t _dynamic_expressions; }; template<> struct where_t { - using _is_where = std::true_type; - using _is_dynamic = std::false_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; where_t(bool condition): _condition(condition) @@ -129,9 +123,8 @@ namespace sqlpp struct no_where_t { - using _is_noop = std::true_type; - using _provided_tables = detail::type_set<>; - using _required_tables = ::sqlpp::detail::type_set<>; + using _traits = make_traits; + using _recursive_traits = make_recursive_traits<>; template struct _methods_t diff --git a/tests/FunctionTest.cpp b/tests/FunctionTest.cpp index 6d70f246..bc02891b 100644 --- a/tests/FunctionTest.cpp +++ b/tests/FunctionTest.cpp @@ -26,7 +26,7 @@ #include "Sample.h" #include "MockDb.h" #include -//#include +#include #include #include @@ -171,7 +171,6 @@ int main() // SUB_SELECT_FUNCTIONS // -------------------- -#if 0 // Test exists { using TI = decltype(exists(select(t.alpha).from(t))); @@ -189,6 +188,9 @@ int main() // Test any { + using S = decltype(select(t.alpha).from(t)); + static_assert(sqlpp::is_numeric_t::value, "type requirement"); + static_assert(sqlpp::is_numeric_t::value, "type requirement"); using TI = decltype(any(select(t.alpha).from(t))); using TT = decltype(any(select(t.beta).from(t))); @@ -233,7 +235,6 @@ int main() static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); static_assert(sqlpp::is_text_t::value, "type requirement"); } -#endif // NUMERIC FUNCTIONS // -----------------