From d0d5fd2969f253bcf4969c4bccab96ba182d9b8b Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Sun, 29 Sep 2013 09:02:51 +0200 Subject: [PATCH] Replaced tag_yes and tag_no by std::true_type and std::false_type --- include/sqlpp11/alias.h | 6 ++-- include/sqlpp11/any.h | 2 +- include/sqlpp11/assignment_list.h | 2 +- include/sqlpp11/avg.h | 2 +- include/sqlpp11/boolean.h | 6 ++-- include/sqlpp11/column.h | 6 ++-- include/sqlpp11/concat.h | 2 +- include/sqlpp11/count.h | 2 +- include/sqlpp11/detail/tag.h | 40 ------------------------ include/sqlpp11/exists.h | 2 +- include/sqlpp11/expression.h | 2 +- include/sqlpp11/from.h | 6 ++-- include/sqlpp11/group_by.h | 6 ++-- include/sqlpp11/having.h | 6 ++-- include/sqlpp11/insert_list.h | 2 +- include/sqlpp11/join.h | 4 +-- include/sqlpp11/like.h | 2 +- include/sqlpp11/limit.h | 6 ++-- include/sqlpp11/max.h | 2 +- include/sqlpp11/min.h | 2 +- include/sqlpp11/multi_column.h | 4 +-- include/sqlpp11/numeric.h | 6 ++-- include/sqlpp11/offset.h | 6 ++-- include/sqlpp11/order_by.h | 6 ++-- include/sqlpp11/select.h | 4 +-- include/sqlpp11/select_expression_list.h | 8 ++--- include/sqlpp11/select_flag_list.h | 8 ++--- include/sqlpp11/some.h | 2 +- include/sqlpp11/sort_order.h | 2 +- include/sqlpp11/sum.h | 2 +- include/sqlpp11/table_base.h | 8 ++--- include/sqlpp11/text.h | 6 ++-- include/sqlpp11/type_traits.h | 13 ++++---- include/sqlpp11/using.h | 2 +- include/sqlpp11/where.h | 6 ++-- tests/SelectTest.cpp | 4 +-- tests/TabSample.h | 16 +++++----- 37 files changed, 86 insertions(+), 125 deletions(-) delete mode 100644 include/sqlpp11/detail/tag.h diff --git a/include/sqlpp11/alias.h b/include/sqlpp11/alias.h index 4ea1f859..32b1f165 100644 --- a/include/sqlpp11/alias.h +++ b/include/sqlpp11/alias.h @@ -87,9 +87,9 @@ namespace sqlpp { struct _value_type: Expression::_value_type { - using _is_expression = tag_no; - using _is_named_expression = tag_yes; - using _is_alias = tag_yes; + using _is_expression = std::false_type; + using _is_named_expression = std::true_type; + using _is_alias = std::true_type; }; using _name_t = typename AliasProvider::_name_t; diff --git a/include/sqlpp11/any.h b/include/sqlpp11/any.h index 3130a69e..c9d4c970 100644 --- a/include/sqlpp11/any.h +++ b/include/sqlpp11/any.h @@ -42,7 +42,7 @@ namespace sqlpp struct _value_type: public Select::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/assignment_list.h b/include/sqlpp11/assignment_list.h index bb5024b7..6db35f3f 100644 --- a/include/sqlpp11/assignment_list.h +++ b/include/sqlpp11/assignment_list.h @@ -50,7 +50,7 @@ namespace sqlpp using _prohibited_assignment_set = typename detail::make_set_if::type; static_assert(_prohibited_assignment_set::size::value == 0, "at least one assignment is prohibited by its column definition in set()"); - using _is_assignment_list = tag_yes; + using _is_assignment_list = std::true_type; template void serialize(std::ostream& os, Db& db) const diff --git a/include/sqlpp11/avg.h b/include/sqlpp11/avg.h index fea4e42d..419ebd29 100644 --- a/include/sqlpp11/avg.h +++ b/include/sqlpp11/avg.h @@ -41,7 +41,7 @@ namespace sqlpp struct _value_type: public Expr::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/boolean.h b/include/sqlpp11/boolean.h index 21a80a25..bf38f541 100644 --- a/include/sqlpp11/boolean.h +++ b/include/sqlpp11/boolean.h @@ -60,9 +60,9 @@ namespace sqlpp struct boolean { using _base_value_type = boolean; - using _is_boolean = tag_yes; - using _is_value = tag_yes; - using _is_expression = tag_yes; + using _is_boolean = std::true_type; + using _is_value = std::true_type; + using _is_expression = std::true_type; struct plus_ { diff --git a/include/sqlpp11/column.h b/include/sqlpp11/column.h index 495643b3..bd3c1be4 100644 --- a/include/sqlpp11/column.h +++ b/include/sqlpp11/column.h @@ -44,9 +44,9 @@ namespace sqlpp using _column_type = typename ColumnSpec::_column_type; struct _value_type: ColumnSpec::_value_type { - using _is_expression = tag_yes; - using _is_named_expression = tag_yes; - using _is_alias = tag_no; + using _is_expression = std::true_type; + using _is_named_expression = std::true_type; + using _is_alias = std::false_type; }; using _name_t = typename ColumnSpec::_name_t; diff --git a/include/sqlpp11/concat.h b/include/sqlpp11/concat.h index c0b0814b..3078dc32 100644 --- a/include/sqlpp11/concat.h +++ b/include/sqlpp11/concat.h @@ -44,7 +44,7 @@ namespace sqlpp struct _value_type: public First::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/count.h b/include/sqlpp11/count.h index 4a3e0774..aaff9064 100644 --- a/include/sqlpp11/count.h +++ b/include/sqlpp11/count.h @@ -41,7 +41,7 @@ namespace sqlpp struct _value_type: public numeric { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/detail/tag.h b/include/sqlpp11/detail/tag.h deleted file mode 100644 index ca7f12da..00000000 --- a/include/sqlpp11/detail/tag.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2013, Roland Bock - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SQLPP_DETAIL_TAG_H -#define SQLPP_DETAIL_TAG_H - -namespace sqlpp -{ - namespace detail - { - struct tag {}; - } - using tag_yes = detail::tag; - using tag_no = void; -} - -#endif diff --git a/include/sqlpp11/exists.h b/include/sqlpp11/exists.h index 2b04d8d8..0b52beda 100644 --- a/include/sqlpp11/exists.h +++ b/include/sqlpp11/exists.h @@ -41,7 +41,7 @@ namespace sqlpp struct _value_type: public boolean { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/expression.h b/include/sqlpp11/expression.h index 2f1673fc..e47ac07f 100644 --- a/include/sqlpp11/expression.h +++ b/include/sqlpp11/expression.h @@ -37,7 +37,7 @@ namespace sqlpp template struct assignment_t { - using _is_assignment = tag_yes; + using _is_assignment = std::true_type; using column_type = Lhs; using value_type = Rhs; diff --git a/include/sqlpp11/from.h b/include/sqlpp11/from.h index eaa1521d..568037fe 100644 --- a/include/sqlpp11/from.h +++ b/include/sqlpp11/from.h @@ -39,7 +39,7 @@ namespace sqlpp template struct from_t { - using _is_from = tag_yes; + using _is_from = std::true_type; // ensure one argument at least static_assert(sizeof...(TableOrJoin), "at least one table or join argument required in from"); @@ -67,8 +67,8 @@ namespace sqlpp template struct dynamic_from_t { - using _is_from = tag_yes; - using _is_dynamic = tag_yes; + using _is_from = std::true_type; + using _is_dynamic = std::true_type; template void add(Table&& table) diff --git a/include/sqlpp11/group_by.h b/include/sqlpp11/group_by.h index da2e9580..951e3bbc 100644 --- a/include/sqlpp11/group_by.h +++ b/include/sqlpp11/group_by.h @@ -52,7 +52,7 @@ namespace sqlpp using _valid_expressions = typename detail::make_set_if::type; static_assert(_valid_expressions::size::value == sizeof...(Expr), "at least one argument is not an expression in group_by()"); - using _is_group_by = tag_yes; + using _is_group_by = std::true_type; template void serialize(std::ostream& os, Db& db) const @@ -68,8 +68,8 @@ namespace sqlpp template struct dynamic_group_by_t { - using _is_group_by = tag_yes; - using _is_dynamic = tag_yes; + using _is_group_by = std::true_type; + using _is_dynamic = std::true_type; template void add(Expr&& expr) diff --git a/include/sqlpp11/having.h b/include/sqlpp11/having.h index 2202c6bf..2c93561c 100644 --- a/include/sqlpp11/having.h +++ b/include/sqlpp11/having.h @@ -41,7 +41,7 @@ namespace sqlpp { static_assert(is_expression_t::value, "invalid expression argument in having()"); - using _is_having = tag_yes; + using _is_having = std::true_type; template void serialize(std::ostream& os, Db& db) const @@ -57,8 +57,8 @@ namespace sqlpp struct dynamic_having_t { - using _is_having = tag_yes; - using _is_dynamic = tag_yes; + using _is_having = std::true_type; + using _is_dynamic = std::true_type; template void add(Expr&& expr) diff --git a/include/sqlpp11/insert_list.h b/include/sqlpp11/insert_list.h index 0ab84bae..cc8c8c44 100644 --- a/include/sqlpp11/insert_list.h +++ b/include/sqlpp11/insert_list.h @@ -64,7 +64,7 @@ namespace sqlpp using _prohibited_assignment_set = typename detail::make_set_if::type; static_assert(_prohibited_assignment_set::size::value == 0, "at least one assignment is prohibited by its column definition in set()"); - using _is_insert_list = tag_yes; + using _is_insert_list = std::true_type; insert_list_t(Assignment... assignment): _columns({assignment._lhs}...), diff --git a/include/sqlpp11/join.h b/include/sqlpp11/join.h index 67be7b32..bc88a735 100644 --- a/include/sqlpp11/join.h +++ b/include/sqlpp11/join.h @@ -58,8 +58,8 @@ namespace sqlpp static_assert(Lhs::_table_set::template is_disjunct_from::value, "joined tables must not be identical"); using _is_table = typename std::conditional::value, - tag_no, - tag_yes>::type; + std::false_type, + std::true_type>::type; using _table_set = typename std::conditional::value, void, typename Lhs::_table_set::template join::type>::type; diff --git a/include/sqlpp11/like.h b/include/sqlpp11/like.h index 907c03d4..bc47ffef 100644 --- a/include/sqlpp11/like.h +++ b/include/sqlpp11/like.h @@ -45,7 +45,7 @@ namespace sqlpp struct _value_type: public Operand::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/limit.h b/include/sqlpp11/limit.h index 97d9f074..35dc03c7 100644 --- a/include/sqlpp11/limit.h +++ b/include/sqlpp11/limit.h @@ -35,7 +35,7 @@ namespace sqlpp { struct limit_t { - using _is_limit = tag_yes; + using _is_limit = std::true_type; template void serialize(std::ostream& os, Db& db) const @@ -48,8 +48,8 @@ namespace sqlpp struct dynamic_limit_t { - using _is_limit = tag_yes; - using _is_dynamic = tag_yes; + using _is_limit = std::true_type; + using _is_dynamic = std::true_type; dynamic_limit_t(): _limit(0) diff --git a/include/sqlpp11/max.h b/include/sqlpp11/max.h index f7da5e1a..1431b576 100644 --- a/include/sqlpp11/max.h +++ b/include/sqlpp11/max.h @@ -41,7 +41,7 @@ namespace sqlpp struct _value_type: public Expr::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/min.h b/include/sqlpp11/min.h index 920d5837..c611f374 100644 --- a/include/sqlpp11/min.h +++ b/include/sqlpp11/min.h @@ -41,7 +41,7 @@ namespace sqlpp struct _value_type: public Expr::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/multi_column.h b/include/sqlpp11/multi_column.h index 69043074..b4327137 100644 --- a/include/sqlpp11/multi_column.h +++ b/include/sqlpp11/multi_column.h @@ -48,9 +48,9 @@ namespace sqlpp struct _value_type: public no_value_t { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; - using _is_multi_column = tag_yes; + using _is_multi_column = std::true_type; template void serialize(std::ostream& os, Db& db) const diff --git a/include/sqlpp11/numeric.h b/include/sqlpp11/numeric.h index e447db36..9aabe223 100644 --- a/include/sqlpp11/numeric.h +++ b/include/sqlpp11/numeric.h @@ -42,9 +42,9 @@ namespace sqlpp struct numeric { using _base_value_type = numeric; - using _is_numeric = tag_yes; - using _is_value = tag_yes; - using _is_expression = tag_yes; + using _is_numeric = std::true_type; + using _is_value = std::true_type; + using _is_expression = std::true_type; template struct _result_entry_t diff --git a/include/sqlpp11/offset.h b/include/sqlpp11/offset.h index 370910ad..159193aa 100644 --- a/include/sqlpp11/offset.h +++ b/include/sqlpp11/offset.h @@ -35,7 +35,7 @@ namespace sqlpp { struct offset_t { - using _is_offset = tag_yes; + using _is_offset = std::true_type; template void serialize(std::ostream& os, Db& db) const @@ -48,8 +48,8 @@ namespace sqlpp struct dynamic_offset_t { - using _is_offset = tag_yes; - using _is_dynamic = tag_yes; + using _is_offset = std::true_type; + using _is_dynamic = std::true_type; dynamic_offset_t(): _offset(0) diff --git a/include/sqlpp11/order_by.h b/include/sqlpp11/order_by.h index d58a75d4..596000b0 100644 --- a/include/sqlpp11/order_by.h +++ b/include/sqlpp11/order_by.h @@ -49,7 +49,7 @@ namespace sqlpp using _valid_expressions = typename detail::make_set_if::type; static_assert(_valid_expressions::size::value == sizeof...(OrderExpr), "at least one argument is not a sort order expression in order_by()"); - using _is_order_by = tag_yes; + using _is_order_by = std::true_type; template void serialize(std::ostream& os, Db& db) const @@ -64,8 +64,8 @@ namespace sqlpp template struct dynamic_order_by_t { - using _is_order_by = tag_yes; - using _is_dynamic = tag_yes; + using _is_order_by = std::true_type; + using _is_dynamic = std::true_type; template void add(Expr&& expr) diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index 05652d3f..83595cf9 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -91,8 +91,8 @@ namespace sqlpp static_assert(is_noop::value or is_limit_t::value, "invalid 'limit' arguments"); static_assert(is_noop::value or is_offset_t::value, "invalid 'offset' arguments"); - using _is_select = tag_yes; - using _requires_braces = tag_yes; + using _is_select = std::true_type; + using _requires_braces = std::true_type; template using set_from_t = select_t; diff --git a/include/sqlpp11/select_expression_list.h b/include/sqlpp11/select_expression_list.h index 8a0ef866..61cdb624 100644 --- a/include/sqlpp11/select_expression_list.h +++ b/include/sqlpp11/select_expression_list.h @@ -65,15 +65,15 @@ namespace sqlpp static_assert(not detail::has_duplicates::value, "at least one duplicate name detected"); // declare this to be a select expression - using _is_select_expression_list = tag_yes; + using _is_select_expression_list = std::true_type; // provide type information for sub-selects that are used as expressions struct _column_type {}; struct _value_type: std::conditional::type::_value_type, no_value_t>::type { - using _is_expression = typename std::conditional::type; - using _is_named_expression = typename std::conditional::type; - using _is_alias = tag_no; + using _is_expression = typename std::conditional::type; + using _is_named_expression = typename std::conditional::type; + using _is_alias = std::false_type; }; struct _no_name_t {}; using _name_t = typename std::conditional::type::_name_t, _no_name_t>::type; diff --git a/include/sqlpp11/select_flag_list.h b/include/sqlpp11/select_flag_list.h index d3d581d6..989f2d7a 100644 --- a/include/sqlpp11/select_flag_list.h +++ b/include/sqlpp11/select_flag_list.h @@ -41,7 +41,7 @@ namespace sqlpp { struct _value_type { - using _is_select_flag = tag_yes; + using _is_select_flag = std::true_type; }; template @@ -56,7 +56,7 @@ namespace sqlpp { struct _value_type { - using _is_select_flag = tag_yes; + using _is_select_flag = std::true_type; }; template @@ -71,7 +71,7 @@ namespace sqlpp { struct _value_type { - using _is_select_flag = tag_yes; + using _is_select_flag = std::true_type; }; template @@ -93,7 +93,7 @@ namespace sqlpp using _valid_flags = typename detail::make_set_if::type; static_assert(_valid_flags::size::value == sizeof...(Flag), "at least one argument is not a select flag in select flag list"); - using _is_select_flag_list = tag_yes; + using _is_select_flag_list = std::true_type; template void serialize(std::ostream& os, Db& db) const diff --git a/include/sqlpp11/some.h b/include/sqlpp11/some.h index 33f095f3..e7affa14 100644 --- a/include/sqlpp11/some.h +++ b/include/sqlpp11/some.h @@ -42,7 +42,7 @@ namespace sqlpp struct _value_type: public Select::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/sort_order.h b/include/sqlpp11/sort_order.h index b4008f63..f85199d7 100644 --- a/include/sqlpp11/sort_order.h +++ b/include/sqlpp11/sort_order.h @@ -38,7 +38,7 @@ namespace sqlpp template struct sort_order_t { - using _is_sort_order = tag_yes; + using _is_sort_order = std::true_type; template void serialize(std::ostream& os, Db& db) const diff --git a/include/sqlpp11/sum.h b/include/sqlpp11/sum.h index f7da5e1a..1431b576 100644 --- a/include/sqlpp11/sum.h +++ b/include/sqlpp11/sum.h @@ -41,7 +41,7 @@ namespace sqlpp struct _value_type: public Expr::_value_type::_base_value_type { - using _is_named_expression = tag_yes; + using _is_named_expression = std::true_type; }; struct _name_t diff --git a/include/sqlpp11/table_base.h b/include/sqlpp11/table_base.h index 13c18cd5..3bf2d2c8 100644 --- a/include/sqlpp11/table_base.h +++ b/include/sqlpp11/table_base.h @@ -46,7 +46,7 @@ namespace sqlpp using _required_insert_columns = typename detail::make_set_if...>::type; using _all_of_t = std::tuple...>; - using _is_table = tag_yes; + using _is_table = std::true_type; template join_t::type> join(T&& t) @@ -57,14 +57,14 @@ namespace sqlpp template struct alias_t: public ColumnSpec::_name_t::template _member_t>... { - using _is_table = tag_yes; + using _is_table = std::true_type; using _table_set = detail::set; struct _value_type: Table::_value_type { - using _is_expression = tag_no; + using _is_expression = std::false_type; using _is_named_expression = copy_type_trait; - using _is_alias = tag_yes; + using _is_alias = std::true_type; }; using _name_t = typename AliasProvider::_name_t; diff --git a/include/sqlpp11/text.h b/include/sqlpp11/text.h index b172b1e1..e7b2473a 100644 --- a/include/sqlpp11/text.h +++ b/include/sqlpp11/text.h @@ -43,9 +43,9 @@ namespace sqlpp struct text { using _base_value_type = text; - using _is_text = tag_yes; - using _is_value = tag_yes; - using _is_expression = tag_yes; + using _is_text = std::true_type; + using _is_value = std::true_type; + using _is_expression = std::true_type; template struct _result_entry_t diff --git a/include/sqlpp11/type_traits.h b/include/sqlpp11/type_traits.h index cf34cb2e..6fa08575 100644 --- a/include/sqlpp11/type_traits.h +++ b/include/sqlpp11/type_traits.h @@ -27,8 +27,9 @@ #ifndef SQLPP_TYPE_TRAITS_H #define SQLPP_TYPE_TRAITS_H +#include #include -#include + namespace sqlpp { #define SQLPP_IS_VALUE_TRAIT_GENERATOR(name) \ @@ -37,7 +38,7 @@ namespace sqlpp template\ struct is_##name##_impl: std::false_type {};\ template\ - struct is_##name##_impl::value>::type>: std::true_type {};\ + struct is_##name##_impl::value>::type>: std::true_type {};\ }\ template\ struct is_##name##_t: detail::is_##name##_impl {}; @@ -48,7 +49,7 @@ namespace sqlpp template\ struct name##_impl: std::false_type {};\ template\ - struct name##_impl::value>::type>: std::true_type {};\ + struct name##_impl::value>::type>: std::true_type {};\ }\ template\ struct name##_t: detail::name##_impl {}; @@ -59,7 +60,7 @@ namespace sqlpp template\ struct name##_impl: std::false_type {};\ template\ - struct name##_impl::value>::type>: std::true_type {};\ + struct name##_impl::value>::type>: std::true_type {};\ }\ template\ struct name##_t: detail::name##_impl {}; @@ -70,7 +71,7 @@ namespace sqlpp template\ struct connector_##name##_impl: std::false_type {};\ template\ - struct connector_##name##_impl::value>::type>: std::true_type {};\ + struct connector_##name##_impl::value>::type>: std::true_type {};\ }\ template\ struct connector_##name##_t: detail::connector_##name##_impl {}; @@ -115,7 +116,7 @@ namespace sqlpp SQLPP_CONNECTOR_TRAIT_GENERATOR(has_empty_list_insert); template class IsTag> - using copy_type_trait = typename std::conditional::value, detail::tag, void>::type; + using copy_type_trait = typename std::conditional::value, std::true_type, std::false_type>::type; template class IsCorrectType> struct operand_t diff --git a/include/sqlpp11/using.h b/include/sqlpp11/using.h index b26024ef..71e1ce7a 100644 --- a/include/sqlpp11/using.h +++ b/include/sqlpp11/using.h @@ -36,7 +36,7 @@ namespace sqlpp template struct using_t { - using _is_using = tag_yes; + using _is_using = std::true_type; static_assert(sizeof...(Table), "at least one table argument required in using"); diff --git a/include/sqlpp11/where.h b/include/sqlpp11/where.h index a1cb00af..0edf896c 100644 --- a/include/sqlpp11/where.h +++ b/include/sqlpp11/where.h @@ -42,7 +42,7 @@ namespace sqlpp { static_assert(is_expression_t::value, "invalid expression argument in where()"); - using _is_where = tag_yes; + using _is_where = std::true_type; template void serialize(std::ostream& os, Db& db) const @@ -58,8 +58,8 @@ namespace sqlpp struct dynamic_where_t { - using _is_where = tag_yes; - using _is_dynamic = tag_yes; + using _is_where = std::true_type; + using _is_dynamic = std::true_type; template void add(Expr&& expr) diff --git a/tests/SelectTest.cpp b/tests/SelectTest.cpp index eb1f7b4f..7adca851 100644 --- a/tests/SelectTest.cpp +++ b/tests/SelectTest.cpp @@ -277,7 +277,7 @@ int main() static_assert(sqlpp::is_select_flag_t::value, "sqlpp::all has to be a select_flag"); using T = sqlpp::detail::wrap_operand::type; static_assert(T::_is_expression, "T has to be an expression"); - static_assert(std::is_same::value, "T has to be a numeric"); + static_assert(std::is_same::value, "T has to be a numeric"); static_assert(sqlpp::is_numeric_t::value, "T has to be a numeric"); static_assert(sqlpp::is_numeric_t::value, "TabSample.alpha has to be a numeric"); ((t.alpha + 7) + 4).asc(); @@ -291,7 +291,7 @@ int main() static_assert(sqlpp::must_not_insert_t::value, "alpha must not be inserted"); t.alpha.serialize(std::cerr, db); std::cerr << "\n" << sizeof(TabSample) << std::endl; - static_assert(std::is_same::value, "alpha should be a named expression"); + static_assert(std::is_same::value, "alpha should be a named expression"); static_assert(sqlpp::is_named_expression_t::value, "alpha should be a named expression"); static_assert(sqlpp::is_named_expression_t::value, "an alias of alpha should be a named expression"); static_assert(sqlpp::is_alias_t::value, "an alias of alpha should be an alias"); diff --git a/tests/TabSample.h b/tests/TabSample.h index 26338c9d..de775026 100644 --- a/tests/TabSample.h +++ b/tests/TabSample.h @@ -89,10 +89,10 @@ namespace TabSample_ using _value_type = sqlpp::bigint; struct _column_type { - using _must_not_insert = sqlpp::tag_yes; - using _must_not_update = sqlpp::tag_yes; - using _can_be_null = sqlpp::tag_yes; - using _trivial_value_is_null = sqlpp::tag_yes; + using _must_not_insert = std::true_type; + using _must_not_update = std::true_type; + using _can_be_null = std::true_type; + using _trivial_value_is_null = std::true_type; using _foreign_key = decltype(TabFoo::omega); }; }; @@ -111,9 +111,9 @@ namespace TabSample_ using _value_type = sqlpp::varchar; struct _column_type { - using _can_be_null = sqlpp::tag_yes; - using _trivial_value_is_null = sqlpp::tag_yes; - using _must_not_update = sqlpp::tag_yes; + using _can_be_null = std::true_type; + using _trivial_value_is_null = std::true_type; + using _must_not_update = std::true_type; }; }; @@ -131,7 +131,7 @@ namespace TabSample_ using _value_type = sqlpp::boolean; struct _column_type { - using _require_insert = sqlpp::tag_yes; + using _require_insert = std::true_type; }; }; }