Skip to content

Commit 6c70086

Browse files
committed
Used conservative void_t polyfill metafunction
1 parent 0b365ff commit 6c70086

File tree

6 files changed

+24
-2
lines changed

6 files changed

+24
-2
lines changed

dev/field_printer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace sqlite_orm {
2828
/*
2929
* Implementation note: the technique of indirect expression testing is because
3030
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
31+
* It must also be a type that differs from those for `is_field_of_v`, `is_preparable_v`, `is_bindable_v`.
3132
*/
3233
template<class Printer>
3334
struct indirectly_test_printable;

dev/functional/cxx_type_traits_polyfill.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ namespace sqlite_orm {
99
#if __cpp_lib_void_t >= 201411L
1010
using std::void_t;
1111
#else
12+
/*
13+
* Implementation note: Conservative implementation due to CWG issue 1558 (Unused arguments in alias template specializations).
14+
*/
1215
template<class...>
13-
using void_t = void;
16+
struct always_void {
17+
using type = void;
18+
};
19+
template<class... T>
20+
using void_t = typename always_void<T...>::type;
1421
#endif
1522

1623
#if __cpp_lib_bool_constant >= 201505L

dev/statement_binder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace sqlite_orm {
3434
/*
3535
* Implementation note: the technique of indirect expression testing is because
3636
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
37+
* It must also be a type that differs from those for `is_field_of_v`, `is_printable_v`, `is_preparable_v`.
3738
*/
3839
template<class Binder>
3940
struct indirectly_test_bindable;

dev/storage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ namespace sqlite_orm {
6161
/*
6262
* Implementation note: the technique of indirect expression testing is because
6363
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
64+
* It must also be a type that differs from those for `is_field_of_v`, `is_printable_v`, `is_bindable_v`.
6465
*/
6566
template<class Binder>
6667
struct indirectly_test_preparable;

dev/table_type_of.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ namespace sqlite_orm {
5656
/*
5757
* Implementation note: the technique of indirect expression testing is because
5858
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
59+
* It must also be a type that differs from those for `is_printable_v`, `is_bindable_v`, `is_preparable_v`.
5960
*/
6061
template<class FieldOf>
6162
struct indirectly_test_field_of;

include/sqlite_orm/sqlite_orm.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,15 @@ namespace sqlite_orm {
257257
#if __cpp_lib_void_t >= 201411L
258258
using std::void_t;
259259
#else
260+
/*
261+
* Implementation note: Conservative implementation due to CWG issue 1558 (Unused arguments in alias template specializations).
262+
*/
260263
template<class...>
261-
using void_t = void;
264+
struct always_void {
265+
using type = void;
266+
};
267+
template<class... T>
268+
using void_t = typename always_void<T...>::type;
262269
#endif
263270

264271
#if __cpp_lib_bool_constant >= 201505L
@@ -1593,6 +1600,7 @@ namespace sqlite_orm {
15931600
/*
15941601
* Implementation note: the technique of indirect expression testing is because
15951602
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
1603+
* It must also be a type that differs from those for `is_printable_v`, `is_bindable_v`, `is_preparable_v`.
15961604
*/
15971605
template<class FieldOf>
15981606
struct indirectly_test_field_of;
@@ -2957,6 +2965,7 @@ namespace sqlite_orm {
29572965
/*
29582966
* Implementation note: the technique of indirect expression testing is because
29592967
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
2968+
* It must also be a type that differs from those for `is_field_of_v`, `is_preparable_v`, `is_bindable_v`.
29602969
*/
29612970
template<class Printer>
29622971
struct indirectly_test_printable;
@@ -8824,6 +8833,7 @@ namespace sqlite_orm {
88248833
/*
88258834
* Implementation note: the technique of indirect expression testing is because
88268835
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
8836+
* It must also be a type that differs from those for `is_field_of_v`, `is_printable_v`, `is_preparable_v`.
88278837
*/
88288838
template<class Binder>
88298839
struct indirectly_test_bindable;
@@ -19097,6 +19107,7 @@ namespace sqlite_orm {
1909719107
/*
1909819108
* Implementation note: the technique of indirect expression testing is because
1909919109
* of older compilers having problems with the detection of dependent templates [SQLITE_ORM_BROKEN_ALIAS_TEMPLATE_DEPENDENT_EXPR_SFINAE].
19110+
* It must also be a type that differs from those for `is_field_of_v`, `is_printable_v`, `is_bindable_v`.
1910019111
*/
1910119112
template<class Binder>
1910219113
struct indirectly_test_preparable;

0 commit comments

Comments
 (0)