mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Cleaned up logic.h
all_t was not to be used as a type but as a value, thus, it should be `all`. Same with any and none.
This commit is contained in:
parent
f04a597bf5
commit
cc49ba1524
@ -141,7 +141,7 @@ namespace sqlpp
|
||||
struct check_cte_union
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_statement_t<T>::value...>::value, assert_cte_union_args_are_statements_t>>;
|
||||
static_check_t<logic::all<is_statement_t<T>::value...>::value, assert_cte_union_args_are_statements_t>>;
|
||||
};
|
||||
template <typename... T>
|
||||
using check_cte_union_t = typename check_cte_union<T...>::type;
|
||||
|
@ -93,7 +93,7 @@ namespace sqlpp
|
||||
struct check_group_by
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_group_by_column<Columns>::value...>::value, assert_group_by_args_are_columns_t>>;
|
||||
static_check_t<logic::all<is_group_by_column<Columns>::value...>::value, assert_group_by_args_are_columns_t>>;
|
||||
};
|
||||
template <typename... Columns>
|
||||
using check_group_by_t = typename check_group_by<Columns...>::type;
|
||||
|
@ -109,7 +109,7 @@ namespace sqlpp
|
||||
template <typename... Exprs>
|
||||
constexpr auto are_all_parameters_expressions() -> bool
|
||||
{
|
||||
return logic::all_t<is_expression_t<Exprs>::value...>::value;
|
||||
return logic::all<is_expression_t<Exprs>::value...>::value;
|
||||
}
|
||||
|
||||
// NO HAVING YET
|
||||
@ -135,7 +135,7 @@ namespace sqlpp
|
||||
|
||||
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
|
||||
// template <typename... T>
|
||||
// using _check = logic::all_t<is_expression_t<T>::value...>;
|
||||
// using _check = logic::all<is_expression_t<T>::value...>;
|
||||
template <typename... T>
|
||||
struct _check : std::integral_constant<bool, are_all_parameters_expressions<T...>()>
|
||||
{
|
||||
|
@ -147,7 +147,7 @@ namespace sqlpp
|
||||
|
||||
template <typename... Assignments>
|
||||
using check_insert_set_t = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_assignment<Assignments>::value...>::value,
|
||||
static_check_t<logic::all<is_assignment<Assignments>::value...>::value,
|
||||
assert_insert_set_assignments_t>,
|
||||
static_check_t<not detail::has_duplicates<typename lhs<Assignments>::type...>::value,
|
||||
assert_insert_set_no_duplicates_t>,
|
||||
@ -260,13 +260,13 @@ namespace sqlpp
|
||||
template <typename... Assignments>
|
||||
void add_values(Assignments... assignments)
|
||||
{
|
||||
static_assert(logic::all_t<is_assignment<Assignments>::value...>::value,
|
||||
static_assert(logic::all<is_assignment<Assignments>::value...>::value,
|
||||
"add_values() arguments have to be assignments");
|
||||
using _arg_value_tuple = std::tuple<insert_value_t<lhs_t<Assignments>>...>;
|
||||
using _args_correct = std::is_same<_arg_value_tuple, _value_tuple_t>;
|
||||
static_assert(_args_correct::value, "add_values() arguments do not match columns() arguments");
|
||||
|
||||
using ok = logic::all_t<logic::all_t<is_assignment<Assignments>::value...>::value, _args_correct::value>;
|
||||
using ok = logic::all<logic::all<is_assignment<Assignments>::value...>::value, _args_correct::value>;
|
||||
|
||||
_add_impl(ok(), assignments...); // dispatch to prevent compile messages after the static_assert
|
||||
}
|
||||
@ -303,7 +303,7 @@ namespace sqlpp
|
||||
struct check_insert_columns
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_column_t<Columns>::value...>::value, assert_insert_columns_are_columns>>;
|
||||
static_check_t<logic::all<is_column_t<Columns>::value...>::value, assert_insert_columns_are_columns>>;
|
||||
};
|
||||
template <typename... Columns>
|
||||
using check_insert_columns_t = typename check_insert_columns<Columns...>::type;
|
||||
|
@ -86,7 +86,7 @@ namespace sqlpp
|
||||
template <typename... Exprs>
|
||||
struct check_order_by
|
||||
{
|
||||
using type = static_combined_check_t<static_check_t<logic::all_t<is_sort_order<Exprs>::value...>::value,
|
||||
using type = static_combined_check_t<static_check_t<logic::all<is_sort_order<Exprs>::value...>::value,
|
||||
assert_order_by_args_are_sort_order_expressions_t>>;
|
||||
};
|
||||
template <typename... Exprs>
|
||||
|
@ -233,8 +233,8 @@ namespace sqlpp
|
||||
: public std::integral_constant<
|
||||
bool,
|
||||
(detail::type_vector_size<KnownAggregateColumns>::value == 0 and
|
||||
logic::none_t<contains_aggregate_function<remove_dynamic_t<remove_as_t<Columns>>>::value...>::value) or
|
||||
logic::all_t<is_aggregate_expression<KnownAggregateColumns,
|
||||
logic::none<contains_aggregate_function<remove_dynamic_t<remove_as_t<Columns>>>::value...>::value) or
|
||||
logic::all<is_aggregate_expression<KnownAggregateColumns,
|
||||
remove_dynamic_t<remove_as_t<Columns>>>::value...>::value>
|
||||
{
|
||||
};
|
||||
@ -258,7 +258,7 @@ namespace sqlpp
|
||||
struct check_selected_tuple<std::tuple<T...>>
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<(select_column_has_value_type<T>::value and select_column_has_name<T>::value)...>::value,
|
||||
static_check_t<logic::all<(select_column_has_value_type<T>::value and select_column_has_name<T>::value)...>::value,
|
||||
assert_selected_colums_are_selectable_t>>;
|
||||
};
|
||||
template <typename T>
|
||||
|
@ -81,7 +81,7 @@ namespace sqlpp
|
||||
struct check_select_flags
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_select_flag_t<Flags>::value...>::value, assert_select_flags_are_flags_t>>;
|
||||
static_check_t<logic::all<is_select_flag_t<Flags>::value...>::value, assert_select_flags_are_flags_t>>;
|
||||
};
|
||||
template <typename... Flags>
|
||||
using check_select_flags_t = typename check_select_flags<Flags...>::type;
|
||||
|
@ -98,7 +98,7 @@ namespace sqlpp
|
||||
struct check_union
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_statement_t<T>::value...>::value, assert_union_args_are_statements_t>>;
|
||||
static_check_t<logic::all<is_statement_t<T>::value...>::value, assert_union_args_are_statements_t>>;
|
||||
};
|
||||
template <typename... T>
|
||||
using check_union_t = typename check_union<T...>::type;
|
||||
|
@ -91,7 +91,7 @@ namespace sqlpp
|
||||
|
||||
template <typename... Assignments>
|
||||
using check_update_set_t = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_assignment<Assignments>::value...>::value,
|
||||
static_check_t<logic::all<is_assignment<Assignments>::value...>::value,
|
||||
assert_update_set_assignments_t>,
|
||||
static_check_t<not detail::has_duplicates<typename lhs<Assignments>::type...>::value,
|
||||
assert_update_set_no_duplicates_t>,
|
||||
|
@ -79,7 +79,7 @@ namespace sqlpp
|
||||
struct check_using
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<is_table<Tables>::value...>::value, assert_using_args_are_tables_t>>;
|
||||
static_check_t<logic::all<is_table<Tables>::value...>::value, assert_using_args_are_tables_t>>;
|
||||
};
|
||||
template <typename... Tables>
|
||||
using check_using_t = typename check_using<Tables...>::type;
|
||||
|
@ -117,9 +117,9 @@ namespace sqlpp
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/2173198
|
||||
// template <typename... Expressions>
|
||||
// using check_where_t = static_combined_check_t<
|
||||
// static_check_t<logic::all_t<is_boolean<Expressions>::value...>::value,
|
||||
// static_check_t<logic::all<is_boolean<Expressions>::value...>::value,
|
||||
// assert_where_arg_is_boolean_expression_t>,
|
||||
// static_check_t<logic::all_t<(not contains_aggregate_function<Expressions>::value)...>::value,
|
||||
// static_check_t<logic::all<(not contains_aggregate_function<Expressions>::value)...>::value,
|
||||
// assert_where_arg_contains_no_aggregate_t>>;
|
||||
template <typename Expression>
|
||||
struct check_where
|
||||
|
@ -42,7 +42,7 @@ namespace sqlpp
|
||||
template <typename... Expressions>
|
||||
struct with_data_t
|
||||
{
|
||||
using _is_recursive = logic::any_t<Expressions::_is_recursive...>;
|
||||
using _is_recursive = logic::any<Expressions::_is_recursive...>;
|
||||
|
||||
with_data_t(Expressions... expressions) : _expressions(expressions...)
|
||||
{
|
||||
@ -140,9 +140,9 @@ namespace sqlpp
|
||||
template <typename... Expressions>
|
||||
auto with(Expressions... cte) -> blank_with_t<Expressions...>
|
||||
{
|
||||
static_assert(logic::all_t<is_cte_t<Expressions>::value...>::value,
|
||||
static_assert(logic::all<is_cte_t<Expressions>::value...>::value,
|
||||
"at least one expression in with is not a common table expression");
|
||||
static_assert(logic::none_t<is_alias_t<Expressions>::value...>::value,
|
||||
static_assert(logic::none<is_alias_t<Expressions>::value...>::value,
|
||||
"at least one expression in with is an incomplete common table expression");
|
||||
return {{cte...}};
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ namespace sqlpp
|
||||
struct make_intersect_set<type_set<LhsElements...>, type_set<RhsElements...>>
|
||||
{
|
||||
template <typename E>
|
||||
using is_in_both = ::sqlpp::logic::all_t<type_set<LhsElements...>::template count<E>(),
|
||||
using is_in_both = ::sqlpp::logic::all<type_set<LhsElements...>::template count<E>(),
|
||||
type_set<RhsElements...>::template count<E>()>;
|
||||
using type = make_type_set_if_t<is_in_both, LhsElements...>;
|
||||
};
|
||||
|
@ -37,7 +37,7 @@ namespace sqlpp
|
||||
struct type_vector
|
||||
{
|
||||
template<typename X>
|
||||
using contains = std::integral_constant<bool, ::sqlpp::logic::any_t<std::is_same<T, X>::value...>::value>;
|
||||
using contains = std::integral_constant<bool, ::sqlpp::logic::any<std::is_same<T, X>::value...>::value>;
|
||||
};
|
||||
|
||||
template <typename... T>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013-2015, Roland Bock
|
||||
* Copyright (c) 2013, Roland Bock
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
@ -38,50 +38,22 @@ namespace sqlpp
|
||||
|
||||
// see http://lists.boost.org/Archives/boost/2014/05/212946.php :-)
|
||||
|
||||
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
|
||||
template <bool... B>
|
||||
struct all
|
||||
struct all : public std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>
|
||||
{
|
||||
using type = std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>;
|
||||
};
|
||||
|
||||
template <bool... B>
|
||||
using all_t = std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>;
|
||||
|
||||
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
|
||||
template <bool... B>
|
||||
struct any
|
||||
: public std::integral_constant<bool,
|
||||
not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>
|
||||
{
|
||||
using type =
|
||||
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>;
|
||||
};
|
||||
|
||||
template <bool... B>
|
||||
using any_t =
|
||||
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>;
|
||||
|
||||
template <bool... B>
|
||||
using none_t = std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>;
|
||||
|
||||
template <bool>
|
||||
struct not_impl;
|
||||
|
||||
template <>
|
||||
struct not_impl<true>
|
||||
struct none : public std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>
|
||||
{
|
||||
using type = std::false_type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct not_impl<false>
|
||||
{
|
||||
using type = std::true_type;
|
||||
};
|
||||
|
||||
template <template <typename> class Predicate, typename T>
|
||||
using not_t = typename not_impl<Predicate<T>::value>::type;
|
||||
|
||||
template <typename T>
|
||||
using identity_t = T;
|
||||
} // namespace logic
|
||||
} // namespace sqlpp
|
||||
|
@ -80,7 +80,7 @@ namespace sqlpp
|
||||
|
||||
template <typename L, typename... Args>
|
||||
using check_in_args =
|
||||
::sqlpp::enable_if_t<(sizeof...(Args) != 0) and logic::all_t<values_are_comparable<L, Args>::value...>::value>;
|
||||
::sqlpp::enable_if_t<(sizeof...(Args) != 0) and logic::all<values_are_comparable<L, Args>::value...>::value>;
|
||||
|
||||
template <typename L, typename Operator, typename R>
|
||||
struct value_type_of<in_expression<L, Operator, std::vector<R>>>
|
||||
@ -93,7 +93,7 @@ namespace sqlpp
|
||||
template <typename L, typename Operator, typename... Args>
|
||||
struct value_type_of<in_expression<L, Operator, std::tuple<Args...>>>
|
||||
: std::conditional<sqlpp::is_optional<value_type_of_t<L>>::value or
|
||||
logic::any_t<sqlpp::is_optional<value_type_of_t<Args>>::value...>::value,
|
||||
logic::any<sqlpp::is_optional<value_type_of_t<Args>>::value...>::value,
|
||||
::sqlpp::optional<boolean>,
|
||||
boolean>
|
||||
{
|
||||
|
@ -69,15 +69,11 @@ namespace sqlpp
|
||||
template <typename Context>
|
||||
auto to_sql_string(Context& , const sort_type& t) -> std::string
|
||||
{
|
||||
switch (t)
|
||||
if (t == sort_type::asc)
|
||||
{
|
||||
case sort_type::asc:
|
||||
return " ASC";
|
||||
break;
|
||||
case sort_type::desc:
|
||||
return " DESC";
|
||||
break;
|
||||
return " ASC";
|
||||
}
|
||||
return " DESC";
|
||||
}
|
||||
|
||||
template <typename Context, typename L>
|
||||
|
@ -184,7 +184,7 @@ namespace sqlpp
|
||||
result_row_t<RDb, RFields...>,
|
||||
typename std::enable_if<sizeof...(LFields) == sizeof...(RFields)>::type>
|
||||
{
|
||||
static constexpr auto value = logic::all_t<is_field_compatible<LFields, RFields>::value...>::value;
|
||||
static constexpr auto value = logic::all<is_field_compatible<LFields, RFields>::value...>::value;
|
||||
};
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ namespace sqlpp
|
||||
template <typename... Policies>
|
||||
constexpr auto is_any_policy_missing() -> bool
|
||||
{
|
||||
return logic::any_t<is_missing_t<Policies>::value...>::value;
|
||||
return logic::any<is_missing_t<Policies>::value...>::value;
|
||||
}
|
||||
|
||||
template <typename... Policies>
|
||||
@ -88,25 +88,25 @@ namespace sqlpp
|
||||
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
|
||||
// template <typename... Expressions>
|
||||
// using _no_unknown_aggregates =
|
||||
// logic::any_t<_all_provided_aggregates::size::value == 0,
|
||||
// logic::all_t<is_aggregate_expression_t<_all_provided_aggregates,
|
||||
// logic::any<_all_provided_aggregates::size::value == 0,
|
||||
// logic::all<is_aggregate_expression_t<_all_provided_aggregates,
|
||||
// Expressions>::value...>::value>;
|
||||
template <typename... Expressions>
|
||||
using _no_unknown_aggregates =
|
||||
logic::any_t<_all_provided_aggregates::size::value == 0,
|
||||
logic::all_t<detail::is_aggregate_expression_impl<_all_provided_aggregates,
|
||||
logic::any<_all_provided_aggregates::size::value == 0,
|
||||
logic::all<detail::is_aggregate_expression_impl<_all_provided_aggregates,
|
||||
Expressions>::type::value...>::value>;
|
||||
|
||||
template <typename... Expressions>
|
||||
using _all_aggregates = logic::any_t<logic::all_t<
|
||||
using _all_aggregates = logic::any<logic::all<
|
||||
detail::is_aggregate_expression_impl<_all_provided_aggregates, Expressions>::type::value...>::value>;
|
||||
|
||||
template <typename... Expressions>
|
||||
using _no_aggregates = logic::any_t<logic::all_t<
|
||||
using _no_aggregates = logic::any<logic::all<
|
||||
detail::is_non_aggregate_expression_impl<_all_provided_aggregates, Expressions>::type::value...>::value>;
|
||||
|
||||
template <template <typename> class Predicate>
|
||||
using any_t = logic::any_t<Predicate<Policies>::value...>;
|
||||
using any_t = logic::any<Predicate<Policies>::value...>;
|
||||
|
||||
// The tables not covered by the from.
|
||||
using _required_tables = detail::make_difference_set_t<_all_required_tables, _all_provided_tables>;
|
||||
@ -135,13 +135,10 @@ namespace sqlpp
|
||||
// then the statement cannot be used as a value
|
||||
value_type_of_t<_result_type_provider>>::type;
|
||||
|
||||
using _traits =
|
||||
make_traits<_value_type, tag_if<tag::is_expression, not std::is_same<_value_type, no_value_t>::value>>;
|
||||
|
||||
using _nodes = detail::type_vector<>;
|
||||
#warning: maybe need to make value type optional
|
||||
/*
|
||||
using _can_be_null = logic::any_t<can_be_null_t<_result_type_provider>::value,
|
||||
using _can_be_null = logic::any<can_be_null_t<_result_type_provider>::value,
|
||||
detail::make_intersect_set_t<required_tables_of_t<_result_type_provider>,
|
||||
_all_provided_outer_tables>::size::value != 0>;
|
||||
*/
|
||||
@ -201,11 +198,11 @@ namespace sqlpp
|
||||
using _traits =
|
||||
make_traits<value_type_of_t<_policies_t>,
|
||||
tag::is_statement,
|
||||
tag_if<tag::is_select, logic::any_t<is_select_t<Policies>::value...>::value>,
|
||||
tag_if<tag::is_select, logic::any<is_select_t<Policies>::value...>::value>,
|
||||
tag_if<tag::is_expression, is_expression_t<_policies_t>::value>,
|
||||
tag_if<tag::is_selectable, is_expression_t<_policies_t>::value>
|
||||
#warning: reactivate
|
||||
//,tag_if<tag::is_return_value, logic::none_t<is_noop_t<_result_type_provider>::value>::value>
|
||||
//,tag_if<tag::is_return_value, logic::none<is_noop_t<_result_type_provider>::value>::value>
|
||||
>;
|
||||
using _name_tag_of = name_tag_of<_result_type_provider>;
|
||||
using _nodes = detail::type_vector<_policies_t>;
|
||||
|
@ -369,7 +369,7 @@ namespace sqlpp
|
||||
struct is_aggregate_expression_impl<KnownAggregates, type_vector<Nodes...>, void>
|
||||
{
|
||||
using type =
|
||||
logic::all_t<sizeof...(Nodes) != 0, is_aggregate_expression_impl<KnownAggregates, Nodes>::type::value...>;
|
||||
logic::all<sizeof...(Nodes) != 0, is_aggregate_expression_impl<KnownAggregates, Nodes>::type::value...>;
|
||||
};
|
||||
} // namespace detail
|
||||
template <typename KnownAggregates, typename T>
|
||||
@ -409,8 +409,8 @@ namespace sqlpp
|
||||
struct is_non_aggregate_expression_impl<KnownAggregates, type_vector<Nodes...>, void>
|
||||
{
|
||||
using type =
|
||||
logic::any_t<sizeof...(Nodes) == 0,
|
||||
logic::all_t<sizeof...(Nodes) != 0,
|
||||
logic::any<sizeof...(Nodes) == 0,
|
||||
logic::all<sizeof...(Nodes) != 0,
|
||||
is_non_aggregate_expression_impl<KnownAggregates, Nodes>::type::value...>::value>;
|
||||
};
|
||||
} // namespace detail
|
||||
|
@ -56,7 +56,7 @@ namespace sqlpp
|
||||
struct contains_aggregate_function<detail::type_vector<T...>>
|
||||
: public std::integral_constant<
|
||||
bool,
|
||||
logic::any_t<(is_aggregate_function<T>::value or contains_aggregate_function<T>::value)...>::value>
|
||||
logic::any<(is_aggregate_function<T>::value or contains_aggregate_function<T>::value)...>::value>
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -78,11 +78,11 @@ namespace sqlpp
|
||||
|
||||
template <typename... Assignments>
|
||||
using check_on_conflict_do_update_set_t = static_combined_check_t<
|
||||
static_check_t<logic::all_t<sqlpp::detail::is_assignment_impl<Assignments>::type::value...>::value,
|
||||
static_check_t<logic::all<sqlpp::detail::is_assignment_impl<Assignments>::type::value...>::value,
|
||||
assert_on_conflict_do_update_set_assignments_t>,
|
||||
static_check_t<not sqlpp::detail::has_duplicates<typename lhs<Assignments>::type...>::value,
|
||||
assert_on_conflict_do_update_set_no_duplicates_t>,
|
||||
static_check_t<logic::none_t<detail::lhs_must_not_update<Assignments>::value...>::value,
|
||||
static_check_t<logic::none<detail::lhs_must_not_update<Assignments>::value...>::value,
|
||||
assert_on_conflict_do_update_set_allowed_t>,
|
||||
static_check_t<sizeof...(Assignments) == 0 or sqlpp::detail::make_joined_set_t<required_tables_of_t<
|
||||
typename lhs<Assignments>::type>...>::size::value == 1,
|
||||
|
@ -239,7 +239,7 @@ namespace sqlpp
|
||||
_data_t _data;
|
||||
|
||||
template <typename... T>
|
||||
struct _check : logic::all_t<is_selectable_t<T>::value...>
|
||||
struct _check : logic::all<is_selectable_t<T>::value...>
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(sqlpp::case_when(when));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
@ -66,7 +66,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(sqlpp::case_when(when).then(then));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
@ -80,7 +80,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(sqlpp::case_when(when).then(then).else_(else_));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace
|
||||
decltype(t.someDayPoint != operand), decltype(t.someDayPoint >= operand), decltype(t.someDayPoint > operand),
|
||||
decltype(t.someDayPoint.in(operand)), decltype(t.someDayPoint.in(operand, operand)),
|
||||
decltype(t.someDayPoint.not_in(operand)), decltype(t.someDayPoint.not_in(operand, operand))>;
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<
|
||||
using ExpectedReturnType = sqlpp::logic::all<
|
||||
Assert::value xor
|
||||
std::is_same<ReturnType, sqlpp::detail::type_set<sqlpp::bad_expression<sqlpp::boolean>>>::value>;
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
|
@ -56,7 +56,7 @@ namespace
|
||||
decltype(t.someTimePoint != operand), decltype(t.someTimePoint >= operand), decltype(t.someTimePoint > operand),
|
||||
decltype(t.someTimePoint.in(operand)), decltype(t.someTimePoint.in(operand, operand)),
|
||||
decltype(t.someTimePoint.not_in(operand)), decltype(t.someTimePoint.not_in(operand, operand))>;
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<
|
||||
using ExpectedReturnType = sqlpp::logic::all<
|
||||
Assert::value xor
|
||||
std::is_same<ReturnType, sqlpp::detail::type_set<sqlpp::bad_expression<sqlpp::boolean>>>::value>;
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
|
@ -53,7 +53,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(select(t.id).from(expression));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(select(all_of(t)).from(t).unconditionally().group_by(t.id).having(expression));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace
|
||||
|
||||
using ReturnType =
|
||||
sqlpp::detail::make_type_set_t<decltype(expr.in(operands...)), decltype(expr.not_in(operands...))>;
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<
|
||||
using ExpectedReturnType = sqlpp::logic::all<
|
||||
Assert::value xor
|
||||
std::is_same<ReturnType, sqlpp::detail::type_set<sqlpp::bad_expression<sqlpp::boolean>>>::value>;
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
|
@ -53,7 +53,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(insert_into(t).set(assignments...));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace
|
||||
using RightOuterJoinType = decltype(sqlpp::right_outer_join(lhs, rhs));
|
||||
using OuterJoinType = decltype(sqlpp::outer_join(lhs, rhs));
|
||||
using CrossJoinType = decltype(sqlpp::cross_join(lhs, rhs));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<
|
||||
using ExpectedReturnType = sqlpp::logic::all<
|
||||
(Assert::value and sqlpp::is_pre_join_t<JoinType>::value and sqlpp::is_pre_join_t<InnerJoinType>::value and
|
||||
sqlpp::is_pre_join_t<LeftOuterJoinType>::value and sqlpp::is_pre_join_t<RightOuterJoinType>::value and
|
||||
sqlpp::is_pre_join_t<OuterJoinType>::value and sqlpp::is_join_t<CrossJoinType>::value) xor
|
||||
@ -83,7 +83,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ResultType = decltype(lhs.on(rhs));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<(Assert::value and sqlpp::is_join_t<ResultType>::value) xor
|
||||
using ExpectedReturnType = sqlpp::logic::all<(Assert::value and sqlpp::is_join_t<ResultType>::value) xor
|
||||
std::is_same<ResultType, Assert>::value>;
|
||||
print_type_on_error<ResultType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
|
@ -54,7 +54,7 @@ namespace
|
||||
using ReturnType = sqlpp::detail::make_type_set_t<decltype(operand < operand), decltype(operand <= operand),
|
||||
decltype(operand == operand), decltype(operand != operand),
|
||||
decltype(operand >= operand), decltype(operand > operand)>;
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<
|
||||
using ExpectedReturnType = sqlpp::logic::all<
|
||||
Assert::value xor
|
||||
std::is_same<ReturnType, sqlpp::detail::type_set<sqlpp::bad_expression<sqlpp::boolean>>>::value>;
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
|
@ -56,7 +56,7 @@ namespace
|
||||
decltype(t.someString != operand), decltype(t.someString >= operand), decltype(t.someString > operand),
|
||||
decltype(t.someString.in(operand)), decltype(t.someString.in(operand, operand)),
|
||||
decltype(t.someString.not_in(operand)), decltype(t.someString.not_in(operand, operand))>;
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<
|
||||
using ExpectedReturnType = sqlpp::logic::all<
|
||||
Assert::value xor
|
||||
std::is_same<ReturnType, sqlpp::detail::type_set<sqlpp::bad_expression<sqlpp::boolean>>>::value>;
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
|
@ -53,7 +53,7 @@ namespace
|
||||
{
|
||||
using ReturnType = decltype(lhs and rhs);
|
||||
using ExpectedReturnType =
|
||||
sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, sqlpp::bad_expression<sqlpp::boolean>>::value>;
|
||||
sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, sqlpp::bad_expression<sqlpp::boolean>>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
@ -63,7 +63,7 @@ namespace
|
||||
{
|
||||
using ReturnType = decltype(lhs or rhs);
|
||||
using ExpectedReturnType =
|
||||
sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, sqlpp::bad_expression<sqlpp::boolean>>::value>;
|
||||
sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, sqlpp::bad_expression<sqlpp::boolean>>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
@ -73,7 +73,7 @@ namespace
|
||||
{
|
||||
using ReturnType = decltype(not lhs);
|
||||
using ExpectedReturnType =
|
||||
sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, sqlpp::bad_expression<sqlpp::boolean>>::value>;
|
||||
sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, sqlpp::bad_expression<sqlpp::boolean>>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
@ -82,7 +82,7 @@ namespace
|
||||
void where_check(const Condition& condition)
|
||||
{
|
||||
using ReturnType = decltype(sqlpp::where(condition));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(update(t).set(expressions...));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ namespace
|
||||
static_assert(ExpectedCheckResult::value, "Unexpected check result");
|
||||
|
||||
using ReturnType = decltype(remove_from(t).where(expression));
|
||||
using ExpectedReturnType = sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
using ExpectedReturnType = sqlpp::logic::all<Assert::value xor std::is_same<ReturnType, Assert>::value>;
|
||||
print_type_on_error<ReturnType>(ExpectedReturnType{});
|
||||
static_assert(ExpectedReturnType::value, "Unexpected return type");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user