Skip to content

Commit 8e67751

Browse files
committed
Merge branch 'streamlined_tuple_algos' into CTEs
2 parents fcf85d6 + 4db6c97 commit 8e67751

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1162
-904
lines changed

dev/alias.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ namespace sqlite_orm {
5252

5353
template<class T>
5454
SQLITE_ORM_INLINE_VAR constexpr bool
55-
is_operator_argument_v<T, std::enable_if_t<polyfill::is_specialization_of_v<T, alias_column_t>>> = true;
55+
is_operator_argument_v<T, std::enable_if_t<polyfill::is_specialization_of<T, alias_column_t>::value>> =
56+
true;
5657

5758
struct basic_table;
5859

@@ -149,7 +150,7 @@ namespace sqlite_orm {
149150

150151
template<class T>
151152
SQLITE_ORM_INLINE_VAR constexpr bool
152-
is_operator_argument_v<T, std::enable_if_t<polyfill::is_specialization_of_v<T, alias_holder>>> = true;
153+
is_operator_argument_v<T, std::enable_if_t<polyfill::is_specialization_of<T, alias_holder>::value>> = true;
153154

154155
#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
155156
template<char A, char... X>
@@ -192,12 +193,12 @@ namespace sqlite_orm {
192193
* using als = alias_u<User>;
193194
* select(alias_column<als>(column<User>(&User::id)))
194195
*/
195-
template<
196-
class A,
197-
class C,
198-
std::enable_if_t<polyfill::conjunction_v<internal::is_table_alias<A>,
199-
polyfill::negation<internal::is_cte_moniker<internal::type_t<A>>>>,
200-
bool> = true>
196+
template<class A,
197+
class C,
198+
std::enable_if_t<
199+
polyfill::conjunction<internal::is_table_alias<A>,
200+
polyfill::negation<internal::is_cte_moniker<internal::type_t<A>>>>::value,
201+
bool> = true>
201202
constexpr auto alias_column(C field) {
202203
using namespace ::sqlite_orm::internal;
203204
using aliased_type = type_t<A>;
@@ -215,13 +216,13 @@ namespace sqlite_orm {
215216
* using als = alias_u<User>;
216217
* select(alias_column<als>(&User::id))
217218
*/
218-
template<
219-
class A,
220-
class F,
221-
class O,
222-
std::enable_if_t<polyfill::conjunction_v<internal::is_table_alias<A>,
223-
polyfill::negation<internal::is_cte_moniker<internal::type_t<A>>>>,
224-
bool> = true>
219+
template<class A,
220+
class F,
221+
class O,
222+
std::enable_if_t<
223+
polyfill::conjunction<internal::is_table_alias<A>,
224+
polyfill::negation<internal::is_cte_moniker<internal::type_t<A>>>>::value,
225+
bool> = true>
225226
constexpr auto alias_column(F O::*field) {
226227
using namespace ::sqlite_orm::internal;
227228
using aliased_type = type_t<A>;

dev/alias_traits.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,35 @@ namespace sqlite_orm {
2121
SQLITE_ORM_INLINE_VAR constexpr bool is_alias_v = std::is_base_of<alias_tag, A>::value;
2222

2323
template<class A>
24-
using is_alias = polyfill::bool_constant<is_alias_v<A>>;
24+
struct is_alias : polyfill::bool_constant<is_alias_v<A>> {};
2525

2626
/** @short Alias of a column in a record set, see `orm_column_alias`.
2727
*/
2828
template<class A>
2929
SQLITE_ORM_INLINE_VAR constexpr bool is_column_alias_v =
30-
polyfill::conjunction_v<is_alias<A>, polyfill::negation<polyfill::is_detected<type_t, A>>>;
30+
polyfill::conjunction<is_alias<A>, polyfill::negation<polyfill::is_detected<type_t, A>>>::value;
3131

3232
template<class A>
33-
using is_column_alias = is_alias<A>;
33+
struct is_column_alias : is_alias<A> {};
3434

3535
/** @short Alias of any type of record set, see `orm_recordset_alias`.
3636
*/
3737
template<class A>
3838
SQLITE_ORM_INLINE_VAR constexpr bool is_recordset_alias_v =
39-
polyfill::conjunction_v<is_alias<A>, polyfill::is_detected<type_t, A>>;
39+
polyfill::conjunction<is_alias<A>, polyfill::is_detected<type_t, A>>::value;
4040

4141
template<class A>
42-
using is_recordset_alias = polyfill::bool_constant<is_recordset_alias_v<A>>;
42+
struct is_recordset_alias : polyfill::bool_constant<is_recordset_alias_v<A>> {};
4343

4444
/** @short Alias of a concrete table, see `orm_table_alias`.
4545
*/
4646
template<class A>
47-
SQLITE_ORM_INLINE_VAR constexpr bool is_table_alias_v = polyfill::conjunction_v<
47+
SQLITE_ORM_INLINE_VAR constexpr bool is_table_alias_v = polyfill::conjunction<
4848
is_recordset_alias<A>,
49-
polyfill::negation<std::is_same<polyfill::detected_t<type_t, A>, std::remove_const_t<A>>>>;
49+
polyfill::negation<std::is_same<polyfill::detected_t<type_t, A>, std::remove_const_t<A>>>>::value;
5050

5151
template<class A>
52-
using is_table_alias = polyfill::bool_constant<is_table_alias_v<A>>;
52+
struct is_table_alias : polyfill::bool_constant<is_table_alias_v<A>> {};
5353

5454
#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
5555
/*

dev/ast/where.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ namespace sqlite_orm {
3131
};
3232

3333
template<class T>
34-
SQLITE_ORM_INLINE_VAR constexpr bool is_where_v = polyfill::is_specialization_of_v<T, where_t>;
34+
SQLITE_ORM_INLINE_VAR constexpr bool is_where_v = polyfill::is_specialization_of<T, where_t>::value;
3535

3636
template<class T>
37-
using is_where = polyfill::bool_constant<is_where_v<T>>;
37+
struct is_where : polyfill::bool_constant<is_where_v<T>> {};
3838
}
3939

4040
/**

dev/ast_iterator.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ namespace sqlite_orm {
150150
};
151151

152152
template<class T>
153-
struct ast_iterator<T,
154-
std::enable_if_t<polyfill::disjunction_v<is_binary_condition<T>, is_binary_operator<T>>>> {
153+
struct ast_iterator<
154+
T,
155+
std::enable_if_t<polyfill::disjunction<is_binary_condition<T>, is_binary_operator<T>>::value>> {
155156
using node_type = T;
156157

157158
template<class L>
@@ -556,7 +557,7 @@ namespace sqlite_orm {
556557
// note: not strictly necessary as there's no binding support for USING;
557558
// we provide it nevertheless, in line with on_t.
558559
template<class T>
559-
struct ast_iterator<T, std::enable_if_t<polyfill::is_specialization_of_v<T, using_t>>> {
560+
struct ast_iterator<T, std::enable_if_t<polyfill::is_specialization_of<T, using_t>::value>> {
560561
using node_type = T;
561562

562563
template<class L>
@@ -685,9 +686,9 @@ namespace sqlite_orm {
685686
*/
686687
template<class T>
687688
struct ast_iterator<T,
688-
std::enable_if_t<polyfill::disjunction_v<polyfill::is_specialization_of<T, alias_holder>,
689-
polyfill::is_specialization_of<T, literal_holder>,
690-
is_column_alias<T>>>> {
689+
std::enable_if_t<polyfill::disjunction<polyfill::is_specialization_of<T, alias_holder>,
690+
polyfill::is_specialization_of<T, literal_holder>,
691+
is_column_alias<T>>::value>> {
691692
using node_type = T;
692693

693694
template<class L>

dev/column_expression.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ namespace sqlite_orm {
6060
* asterisk_t<O> -> tuple<ColExpr...>
6161
*/
6262
template<class DBOs, class E>
63-
struct column_expression_type<
64-
DBOs,
65-
asterisk_t<E>,
66-
std::enable_if_t<polyfill::disjunction_v<polyfill::negation<is_recordset_alias<E>>, is_cte_moniker<E>>>>
63+
struct column_expression_type<DBOs,
64+
asterisk_t<E>,
65+
std::enable_if_t<polyfill::disjunction<polyfill::negation<is_recordset_alias<E>>,
66+
is_cte_moniker<E>>::value>>
6767
: storage_traits::storage_mapped_column_expressions<DBOs, E> {};
6868

6969
template<class A>

dev/column_names_getter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace sqlite_orm {
3434
table.for_each_column([qualified = !context.skip_table_name,
3535
&tableName = table.name,
3636
&collectedExpressions](const column_identifier& column) {
37-
if(is_alias_v<T>) {
37+
if(is_alias<T>::value) {
3838
collectedExpressions.push_back(quote_identifier(alias_extractor<T>::extract()) + "." +
3939
quote_identifier(column.name));
4040
} else if(qualified) {
@@ -46,7 +46,7 @@ namespace sqlite_orm {
4646
});
4747
} else {
4848
collectedExpressions.reserve(collectedExpressions.size() + 1);
49-
if(is_alias_v<T>) {
49+
if(is_alias<T>::value) {
5050
collectedExpressions.push_back(quote_identifier(alias_extractor<T>::extract()) + ".*");
5151
} else if(!context.skip_table_name) {
5252
const basic_table& table = pick_table<mapped_type_proxy_t<T>>(context.db_objects);

0 commit comments

Comments
 (0)