Fixed order_by type check

This commit is contained in:
rbock
2014-11-28 10:10:34 +01:00
parent bf2744d5f7
commit 8d6816be8b
2 changed files with 5 additions and 5 deletions

View File

@@ -192,7 +192,7 @@ namespace sqlpp
-> _new_statement_t<_check<Expressions...>, group_by_t<void, Expressions...>>
{
static_assert(sizeof...(Expressions), "at least one expression (e.g. a column) required in group_by()");
static_assert(detail::all_t<is_expression_t<Expressions>::value...>::value, "at least one argument is not an expression in group_by()");
static_assert(_check<Expressions...>::value, "at least one argument is not an expression in group_by()");
return _group_by_impl<void>(_check<Expressions...>{}, expressions...);
}
@@ -202,7 +202,7 @@ namespace sqlpp
-> _new_statement_t<_check<Expressions...>, group_by_t<_database_t, Expressions...>>
{
static_assert(not std::is_same<_database_t, void>::value, "dynamic_group_by must not be called in a static statement");
static_assert(detail::all_t<is_expression_t<Expressions>::value...>::value, "at least one argument is not an expression in group_by()");
static_assert(_check<Expressions...>::value, "at least one argument is not an expression in group_by()");
return _group_by_impl<_database_t>(_check<Expressions...>{}, expressions...);
}

View File

@@ -180,7 +180,7 @@ namespace sqlpp
using _database_t = typename Policies::_database_t;
template<typename... T>
using _check = detail::all_t<is_expression_t<T>::value...>;
using _check = detail::all_t<is_sort_order_t<T>::value...>;
template<typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_order_by_t, T>;
@@ -192,7 +192,7 @@ namespace sqlpp
-> _new_statement_t<_check<Expressions...>, order_by_t<void, Expressions...>>
{
static_assert(sizeof...(Expressions), "at least one expression (e.g. a column) required in order_by()");
static_assert(detail::all_t<is_expression_t<Expressions>::value...>::value, "at least one argument is not an expression in order_by()");
static_assert(_check<Expressions...>::value, "at least one argument is not a sort order in order_by()");
return _order_by_impl<void>(_check<Expressions...>{}, expressions...);
}
@@ -202,7 +202,7 @@ namespace sqlpp
-> _new_statement_t<_check<Expressions...>, order_by_t<_database_t, Expressions...>>
{
static_assert(not std::is_same<_database_t, void>::value, "dynamic_order_by must not be called in a static statement");
static_assert(detail::all_t<is_expression_t<Expressions>::value...>::value, "at least one argument is not an expression in order_by()");
static_assert(_check<Expressions...>::value, "at least one argument is not a sort order in order_by()");
return _order_by_impl<_database_t>(_check<Expressions...>{}, expressions...);
}