From b212caef5c023b127d391a704df036590c57552a Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 15:51:40 +0500 Subject: [PATCH 01/13] added cpp23 --- .github/workflows/ci.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e762b737..fca08563 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -91,6 +91,7 @@ jobs: # =================== linux: runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental || false }} strategy: fail-fast: false matrix: @@ -111,6 +112,24 @@ jobs: install_compiler: true compiler_package: g++-10 + - name: "clang-14, C++23 (early)" + os: ubuntu-22.04 + cc: clang-14 + cxx: clang++-14 + cxx_standard: "-DSQLITE_ORM_ENABLE_CXX_23=ON" + install_compiler: true + compiler_package: clang-14 + experimental: true + + - name: "gcc-11, C++23 (early)" + os: ubuntu-22.04 + cc: gcc-11 + cxx: g++-11 + cxx_standard: "-DSQLITE_ORM_ENABLE_CXX_23=ON" + install_compiler: true + compiler_package: g++-11 + experimental: true + name: Linux - ${{ matrix.name }} env: From 2b356f3677601dbe5c23b4abf1e656432ac1d999 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 17:03:35 +0500 Subject: [PATCH 02/13] Update .gitignore and enhance tests with C++20 features - Added 'build-local/' to .gitignore to exclude local build artifacts. - Updated tests in 'iterate.cpp' to conditionally compile with C++20 concepts and aliases. - Introduced a new 'clamp_int_ref' function in 'function_static_tests.cpp' for better compatibility with different compilers and improved test coverage. --- .gitignore | 3 +- tests/iterate.cpp | 6 ++++ tests/static_tests/function_static_tests.cpp | 31 ++++++++++++++++---- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 129aed37..6b9916a4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,6 @@ cmake-build-debug/ build/ build-xcode/ build-code-edit/ +build-local/ *.sqlite -*.db \ No newline at end of file +*.db diff --git a/tests/iterate.cpp b/tests/iterate.cpp index 0b9e7f49..66cfb633 100644 --- a/tests/iterate.cpp +++ b/tests/iterate.cpp @@ -76,6 +76,8 @@ TEST_CASE("Iterate select statement") { }; #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED constexpr orm_table_reference auto test_table = c(); +#endif +#ifdef SQLITE_ORM_WITH_CPP20_ALIASES constexpr orm_table_alias auto test_alias = "t"_alias.for_(); #endif @@ -128,14 +130,18 @@ TEST_CASE("Iterate select statement") { auto view = db.yield(); REQUIRE(std::vector{std::from_range, view} == expected_vec); } +#ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED SECTION("object generator, table reference") { auto view = db.yield(); REQUIRE(std::vector{std::from_range, view} == expected_vec); } +#endif +#ifdef SQLITE_ORM_WITH_CPP20_ALIASES SECTION("object generator, alias") { auto view = db.yield(); REQUIRE(std::vector{std::from_range, view} == expected_vec); } +#endif SECTION("select generator") { auto view = db.yield(select(object())); REQUIRE(std::vector{std::from_range, view} == expected_vec); diff --git a/tests/static_tests/function_static_tests.cpp b/tests/static_tests/function_static_tests.cpp index 69cd35a8..8d369ca4 100644 --- a/tests/static_tests/function_static_tests.cpp +++ b/tests/static_tests/function_static_tests.cpp @@ -24,6 +24,10 @@ concept storage_aggregate_callable = requires(S& storage) { { storage.template create_aggregate_function() }; { storage.template delete_aggregate_function() }; }; + +constexpr const int& clamp_int_ref(const int& v, const int& lo, const int& hi) { + return std::clamp(v, lo, hi); +} #endif TEST_CASE("function static") { @@ -343,16 +347,23 @@ TEST_CASE("function static") { } #endif SECTION("freestanding function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + constexpr auto quotedScalar = "f"_scalar.quote(clamp_int_ref); + using quoted_type = decltype("f"_scalar.quote(clamp_int_ref)); + using expected_callable_type = decltype(&clamp_int_ref); +#else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); using quoted_type = decltype("f"_scalar.quote(std::clamp)); + using expected_callable_type = decltype(&std::clamp); +#endif STATIC_REQUIRE(quotedScalar._nme[0] == 'f' && quotedScalar._nme[1] == '\0'); STATIC_REQUIRE(std::is_same_v), + const quoted_scalar_function>); - STATIC_REQUIRE(std::is_same_v)>); + STATIC_REQUIRE(std::is_same_v); STATIC_REQUIRE(std::is_same_v); STATIC_REQUIRE(std::is_same_v::return_type, int>); @@ -370,16 +381,26 @@ TEST_CASE("function static") { STATIC_REQUIRE(storage_scalar_callable); } SECTION("template function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + constexpr auto quotedScalar = + "f"_scalar.quote(clamp_int_ref); + using quoted_type = + decltype("f"_scalar.quote(clamp_int_ref)); + using expected_callable_type = decltype(&clamp_int_ref); +#else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); - using quoted_type = decltype("f"_scalar.quote(std::clamp)); + using quoted_type = + decltype("f"_scalar.quote(std::clamp)); + using expected_callable_type = decltype(&std::clamp); +#endif STATIC_REQUIRE(quotedScalar._nme[0] == 'f' && quotedScalar._nme[1] == '\0'); STATIC_REQUIRE(std::is_same_v), + const quoted_scalar_function>); - STATIC_REQUIRE(std::is_same_v)>); + STATIC_REQUIRE(std::is_same_v); STATIC_REQUIRE(std::is_same_v); STATIC_REQUIRE(std::is_same_v::return_type, int>); From 99023121fececbefa4861de17a39526de9ef719a Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 17:33:01 +0500 Subject: [PATCH 03/13] Refactor type declaration in function static tests - Simplified the type declaration for `quoted_type` in `function_static_tests.cpp` to improve code clarity and maintainability. --- tests/static_tests/function_static_tests.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/static_tests/function_static_tests.cpp b/tests/static_tests/function_static_tests.cpp index 8d369ca4..d1bf0ebe 100644 --- a/tests/static_tests/function_static_tests.cpp +++ b/tests/static_tests/function_static_tests.cpp @@ -389,8 +389,7 @@ TEST_CASE("function static") { using expected_callable_type = decltype(&clamp_int_ref); #else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); - using quoted_type = - decltype("f"_scalar.quote(std::clamp)); + using quoted_type = decltype("f"_scalar.quote(std::clamp)); using expected_callable_type = decltype(&std::clamp); #endif From f71ddac62d3b3641ea16b13f442ccced5ae243b9 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 17:49:34 +0500 Subject: [PATCH 04/13] Enhance tests for C++20 compatibility and fix function references - Updated the `iterate.cpp` test to conditionally compile with C++20 ranges. - Modified references to `clamp_int_ref` in `function_static_tests.cpp` to use address-of operator for better compatibility across compilers. --- tests/iterate.cpp | 2 ++ tests/static_tests/function_static_tests.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/iterate.cpp b/tests/iterate.cpp index 66cfb633..7cc525a9 100644 --- a/tests/iterate.cpp +++ b/tests/iterate.cpp @@ -108,11 +108,13 @@ TEST_CASE("Iterate select statement") { #endif #if __cpp_lib_containers_ranges >= 202202L +#if !defined(__clang__) || (__clang_major__ >= 15) SECTION("from range") { std::ranges::view auto view = db.iterate(select(object())); REQUIRE(std::vector{std::from_range, view} == expected_vec); } #endif +#endif #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #ifdef SQLITE_ORM_WITH_CPP20_ALIASES diff --git a/tests/static_tests/function_static_tests.cpp b/tests/static_tests/function_static_tests.cpp index d1bf0ebe..11252a53 100644 --- a/tests/static_tests/function_static_tests.cpp +++ b/tests/static_tests/function_static_tests.cpp @@ -348,8 +348,8 @@ TEST_CASE("function static") { #endif SECTION("freestanding function") { #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - constexpr auto quotedScalar = "f"_scalar.quote(clamp_int_ref); - using quoted_type = decltype("f"_scalar.quote(clamp_int_ref)); + constexpr auto quotedScalar = "f"_scalar.quote(&clamp_int_ref); + using quoted_type = decltype("f"_scalar.quote(&clamp_int_ref)); using expected_callable_type = decltype(&clamp_int_ref); #else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); @@ -383,9 +383,9 @@ TEST_CASE("function static") { SECTION("template function") { #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) constexpr auto quotedScalar = - "f"_scalar.quote(clamp_int_ref); + "f"_scalar.quote(&clamp_int_ref); using quoted_type = - decltype("f"_scalar.quote(clamp_int_ref)); + decltype("f"_scalar.quote(&clamp_int_ref)); using expected_callable_type = decltype(&clamp_int_ref); #else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); From 3307fe0481aa8d895f64f4a17a4343047e7abfa1 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 18:13:29 +0500 Subject: [PATCH 05/13] Refactor tests for improved compatibility and clarity - Updated `iterate.cpp` to conditionally compile sections based on Clang version for better compatibility with C++20 features. - Refactored references to `clamp_int_ref` in `function_static_tests.cpp` to use a pointer for improved cross-compiler compatibility and clarity. --- tests/iterate.cpp | 4 ++++ tests/static_tests/function_static_tests.cpp | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/iterate.cpp b/tests/iterate.cpp index 7cc525a9..f1d037ad 100644 --- a/tests/iterate.cpp +++ b/tests/iterate.cpp @@ -93,19 +93,23 @@ TEST_CASE("Iterate select statement") { db.replace(expected); std::vector expected_vec{expected}; +#if !defined(__clang__) || (__clang_major__ >= 15) SECTION("range-based for") { for (Test&& obj: db.iterate(select(object()))) { REQUIRE(obj == expected); } } +#endif #ifdef SQLITE_ORM_STL_HAS_DEFAULT_SENTINEL +#if !defined(__clang__) || (__clang_major__ >= 15) SECTION("borrowed iterator") { std::input_iterator auto begin = db.iterate(select(object())).begin(); REQUIRE(*begin == expected); REQUIRE(++begin == std::default_sentinel); } #endif +#endif #if __cpp_lib_containers_ranges >= 202202L #if !defined(__clang__) || (__clang_major__ >= 15) diff --git a/tests/static_tests/function_static_tests.cpp b/tests/static_tests/function_static_tests.cpp index 11252a53..0c522f7c 100644 --- a/tests/static_tests/function_static_tests.cpp +++ b/tests/static_tests/function_static_tests.cpp @@ -28,6 +28,7 @@ concept storage_aggregate_callable = requires(S& storage) { constexpr const int& clamp_int_ref(const int& v, const int& lo, const int& hi) { return std::clamp(v, lo, hi); } +constexpr auto clamp_int_ref_ptr = &clamp_int_ref; #endif TEST_CASE("function static") { @@ -348,9 +349,9 @@ TEST_CASE("function static") { #endif SECTION("freestanding function") { #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - constexpr auto quotedScalar = "f"_scalar.quote(&clamp_int_ref); - using quoted_type = decltype("f"_scalar.quote(&clamp_int_ref)); - using expected_callable_type = decltype(&clamp_int_ref); + constexpr auto quotedScalar = "f"_scalar.quote(clamp_int_ref_ptr); + using quoted_type = decltype("f"_scalar.quote(clamp_int_ref_ptr)); + using expected_callable_type = decltype(clamp_int_ref_ptr); #else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); using quoted_type = decltype("f"_scalar.quote(std::clamp)); @@ -383,10 +384,10 @@ TEST_CASE("function static") { SECTION("template function") { #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) constexpr auto quotedScalar = - "f"_scalar.quote(&clamp_int_ref); + "f"_scalar.quote(clamp_int_ref_ptr); using quoted_type = - decltype("f"_scalar.quote(&clamp_int_ref)); - using expected_callable_type = decltype(&clamp_int_ref); + decltype("f"_scalar.quote(clamp_int_ref_ptr)); + using expected_callable_type = decltype(clamp_int_ref_ptr); #else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); using quoted_type = decltype("f"_scalar.quote(std::clamp)); From d1f0aa0814d2ea474d4f463d7e38149ef1fb7fa8 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 18:29:41 +0500 Subject: [PATCH 06/13] Update compatibility checks for C++20 ranges in serializer and tests - Modified preprocessor directives in `statement_serializer.h` and `sqlite_orm.h` to ensure compatibility with C++20 ranges based on Clang version. - Updated `function_static_tests.cpp` to skip tests for GCC versions below 12, improving compatibility and clarity in function pointer usage. --- dev/statement_serializer.h | 2 +- include/sqlite_orm/sqlite_orm.h | 2 +- tests/static_tests/function_static_tests.cpp | 14 ++++---------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dev/statement_serializer.h b/dev/statement_serializer.h index fc7cc4e7..1206b58c 100644 --- a/dev/statement_serializer.h +++ b/dev/statement_serializer.h @@ -1797,7 +1797,7 @@ namespace sqlite_orm::internal { const Ctx&) SQLITE_ORM_OR_CONST_CALLOP { std::stringstream ss; ss << "SET "; -#ifdef SQLITE_ORM_CPP20_RANGES_SUPPORTED +#if defined(SQLITE_ORM_CPP20_RANGES_SUPPORTED) && (!defined(__clang__) || (__clang_major__ >= 15)) ss << streaming_serialized(statement | std::views::transform(&dynamic_set_entry::serialized_value)); #else int index = 0; diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index 261b4729..05b5acce 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -23457,7 +23457,7 @@ namespace sqlite_orm::internal { const Ctx&) SQLITE_ORM_OR_CONST_CALLOP { std::stringstream ss; ss << "SET "; -#ifdef SQLITE_ORM_CPP20_RANGES_SUPPORTED +#if defined(SQLITE_ORM_CPP20_RANGES_SUPPORTED) && (!defined(__clang__) || (__clang_major__ >= 15)) ss << streaming_serialized(statement | std::views::transform(&dynamic_set_entry::serialized_value)); #else int index = 0; diff --git a/tests/static_tests/function_static_tests.cpp b/tests/static_tests/function_static_tests.cpp index 0c522f7c..59c3f73c 100644 --- a/tests/static_tests/function_static_tests.cpp +++ b/tests/static_tests/function_static_tests.cpp @@ -349,14 +349,11 @@ TEST_CASE("function static") { #endif SECTION("freestanding function") { #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - constexpr auto quotedScalar = "f"_scalar.quote(clamp_int_ref_ptr); - using quoted_type = decltype("f"_scalar.quote(clamp_int_ref_ptr)); - using expected_callable_type = decltype(clamp_int_ref_ptr); + SKIP("GCC < 12 cannot use this function pointer as NTTP in this test."); #else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); using quoted_type = decltype("f"_scalar.quote(std::clamp)); using expected_callable_type = decltype(&std::clamp); -#endif STATIC_REQUIRE(quotedScalar._nme[0] == 'f' && quotedScalar._nme[1] == '\0'); STATIC_REQUIRE(std::is_same_v); +#endif } SECTION("template function") { #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - constexpr auto quotedScalar = - "f"_scalar.quote(clamp_int_ref_ptr); - using quoted_type = - decltype("f"_scalar.quote(clamp_int_ref_ptr)); - using expected_callable_type = decltype(clamp_int_ref_ptr); + SKIP("GCC < 12 cannot use this function pointer as NTTP in this test."); #else constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); using quoted_type = decltype("f"_scalar.quote(std::clamp)); using expected_callable_type = decltype(&std::clamp); -#endif STATIC_REQUIRE(quotedScalar._nme[0] == 'f' && quotedScalar._nme[1] == '\0'); STATIC_REQUIRE(std::is_same_v); +#endif } SECTION("lambda") { constexpr auto lambda = [](unsigned long errcode) { From c67aae78a0742a0e0ed1f9e90fe3249e594a5a06 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 18:50:59 +0500 Subject: [PATCH 07/13] Fix early compiler CI failures in iterator and UDF tests. Gate alias/ranges static iterator checks for older clang and skip NTTP-based quoted scalar cases on gcc-11 where function template arguments are unsupported. Made-with: Cursor --- tests/static_tests/iterator_t.cpp | 8 ++++++-- tests/user_defined_functions.cpp | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/static_tests/iterator_t.cpp b/tests/static_tests/iterator_t.cpp index 66abe8fb..9d734d42 100644 --- a/tests/static_tests/iterator_t.cpp +++ b/tests/static_tests/iterator_t.cpp @@ -126,8 +126,10 @@ concept storage_yield_result_set = requires(S& storage_type, Select select) { namespace { struct Object {}; -#ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED +#if defined(SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED) && defined(SQLITE_ORM_WITH_CPP20_ALIASES) constexpr orm_table_alias auto object_alias = "o"_alias.for_(); +#endif +#ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED constexpr orm_table_reference auto object_table = c(); #endif } @@ -178,8 +180,10 @@ TEST_CASE("can view and iterate mapped") { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED STATIC_REQUIRE(storage_iterate_mapped); STATIC_REQUIRE(storage_iterate_mapped_ref); +#ifdef SQLITE_ORM_WITH_CPP20_ALIASES STATIC_REQUIRE(storage_iterate_mapped_ref); #endif +#endif #ifdef SQLITE_ORM_CPP23_GENERATOR_SUPPORTED STATIC_REQUIRE(storage_yield_mapped); @@ -188,7 +192,7 @@ TEST_CASE("can view and iterate mapped") { #endif } -#ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED +#if defined(SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED) && (!defined(__clang__) || (__clang_major__ >= 15)) TEST_CASE("can view and iterate result set") { struct Object {}; using empty_storage_type = decltype(make_storage("")); diff --git a/tests/user_defined_functions.cpp b/tests/user_defined_functions.cpp index 67d25abb..47bf1222 100644 --- a/tests/user_defined_functions.cpp +++ b/tests/user_defined_functions.cpp @@ -569,6 +569,9 @@ TEST_CASE("generalized scalar udf") { storage.sync_schema(); SECTION("freestanding function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use this function as NTTP in quoted scalar tests."); +#else constexpr auto err_fatal_error_f = "ERR_FATAL_ERROR"_scalar.quote(ERR_FATAL_ERROR); storage.create_scalar_function(); { @@ -577,6 +580,7 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } SECTION("stateless lambda") { constexpr auto is_fatal_error_f = "is_fatal_error"_scalar.quote([](unsigned long errcode) { @@ -659,6 +663,9 @@ TEST_CASE("generalized scalar udf") { } #endif SECTION("specialized template function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use std::clamp specialization as NTTP."); +#else constexpr auto clamp_int_f = "clamp_int"_scalar.quote(std::clamp); storage.create_scalar_function(); { @@ -667,8 +674,12 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } SECTION("overloaded template function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use std::clamp overload as NTTP."); +#else constexpr auto clamp_int_f = "clamp_int"_scalar.quote(std::clamp); storage.create_scalar_function(); @@ -678,6 +689,7 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } SECTION("non-copyable function object") { // note: unlike msvc, gcc+clang require a constant template parameter to be copyable (and probably rightly so); @@ -703,6 +715,9 @@ TEST_CASE("generalized scalar udf") { storage.delete_scalar_function(); } SECTION("escaped function identifier") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use std::clamp specialization as NTTP."); +#else constexpr auto clamp_f = R"("clamp int")"_scalar.quote(std::clamp); storage.create_scalar_function(); { @@ -711,6 +726,7 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } } #endif From f40b48762a25d4f49d8413fb421ea01839e96b66 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Mon, 27 Apr 2026 20:01:35 +0500 Subject: [PATCH 08/13] Gate iterator mapped-ref static checks for clang-14. Skip storage_iterate_mapped_ref static assertions on older clang where table-reference iterate overloads are unavailable. Made-with: Cursor --- tests/static_tests/iterator_t.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/static_tests/iterator_t.cpp b/tests/static_tests/iterator_t.cpp index 9d734d42..aeeee46c 100644 --- a/tests/static_tests/iterator_t.cpp +++ b/tests/static_tests/iterator_t.cpp @@ -179,11 +179,15 @@ TEST_CASE("can view and iterate mapped") { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED STATIC_REQUIRE(storage_iterate_mapped); +#if !defined(__clang__) || (__clang_major__ >= 15) STATIC_REQUIRE(storage_iterate_mapped_ref); +#endif #ifdef SQLITE_ORM_WITH_CPP20_ALIASES +#if !defined(__clang__) || (__clang_major__ >= 15) STATIC_REQUIRE(storage_iterate_mapped_ref); #endif #endif +#endif #ifdef SQLITE_ORM_CPP23_GENERATOR_SUPPORTED STATIC_REQUIRE(storage_yield_mapped); From 8726494c49a198259ab54bddb40f1bc54f8ad6ee Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Tue, 28 Apr 2026 19:33:59 +0500 Subject: [PATCH 09/13] Address review feedback for views feature gating and test compatibility. Introduce SQLITE_ORM_CPP20_VIEWS_SUPPORTED with compiler quirks for clang<=15, switch dynamic_set serialization to views capability checks, and replace ad-hoc compiler guards/skip paths in tests with capability-based and pointer-based clamp handling. Made-with: Cursor --- dev/functional/config.h | 4 +++ dev/functional/cxx_compiler_quirks.h | 4 +++ dev/statement_serializer.h | 2 +- tests/iterate.cpp | 6 ++--- tests/static_tests/function_static_tests.cpp | 27 +++++++------------- tests/static_tests/iterator_t.cpp | 6 ++--- tests/user_defined_functions.cpp | 26 +++++-------------- 7 files changed, 30 insertions(+), 45 deletions(-) diff --git a/dev/functional/config.h b/dev/functional/config.h index 64a62c3b..022a3166 100644 --- a/dev/functional/config.h +++ b/dev/functional/config.h @@ -55,6 +55,10 @@ #define SQLITE_ORM_CPP20_RANGES_SUPPORTED #endif +#if __cpp_lib_ranges >= 202110L +#define SQLITE_ORM_CPP20_VIEWS_SUPPORTED +#endif + #if __cpp_lib_generator >= 202207L #define SQLITE_ORM_CPP23_GENERATOR_SUPPORTED #endif diff --git a/dev/functional/cxx_compiler_quirks.h b/dev/functional/cxx_compiler_quirks.h index 37bdf77f..b99b7135 100644 --- a/dev/functional/cxx_compiler_quirks.h +++ b/dev/functional/cxx_compiler_quirks.h @@ -72,3 +72,7 @@ #if defined(SQLITE_ORM_CONCEPTS_SUPPORTED) && (defined(__clang__) && (__clang_major__ == 10)) #define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS #endif + +#if defined(SQLITE_ORM_CPP20_VIEWS_SUPPORTED) && (defined(__clang__) && (__clang_major__ <= 15)) +#undef SQLITE_ORM_CPP20_VIEWS_SUPPORTED +#endif diff --git a/dev/statement_serializer.h b/dev/statement_serializer.h index 1206b58c..4b906c58 100644 --- a/dev/statement_serializer.h +++ b/dev/statement_serializer.h @@ -1797,7 +1797,7 @@ namespace sqlite_orm::internal { const Ctx&) SQLITE_ORM_OR_CONST_CALLOP { std::stringstream ss; ss << "SET "; -#if defined(SQLITE_ORM_CPP20_RANGES_SUPPORTED) && (!defined(__clang__) || (__clang_major__ >= 15)) +#ifdef SQLITE_ORM_CPP20_VIEWS_SUPPORTED ss << streaming_serialized(statement | std::views::transform(&dynamic_set_entry::serialized_value)); #else int index = 0; diff --git a/tests/iterate.cpp b/tests/iterate.cpp index f1d037ad..62db3bcd 100644 --- a/tests/iterate.cpp +++ b/tests/iterate.cpp @@ -93,7 +93,7 @@ TEST_CASE("Iterate select statement") { db.replace(expected); std::vector expected_vec{expected}; -#if !defined(__clang__) || (__clang_major__ >= 15) +#ifdef SQLITE_ORM_CPP20_VIEWS_SUPPORTED SECTION("range-based for") { for (Test&& obj: db.iterate(select(object()))) { REQUIRE(obj == expected); @@ -102,7 +102,7 @@ TEST_CASE("Iterate select statement") { #endif #ifdef SQLITE_ORM_STL_HAS_DEFAULT_SENTINEL -#if !defined(__clang__) || (__clang_major__ >= 15) +#ifdef SQLITE_ORM_CPP20_VIEWS_SUPPORTED SECTION("borrowed iterator") { std::input_iterator auto begin = db.iterate(select(object())).begin(); REQUIRE(*begin == expected); @@ -112,7 +112,7 @@ TEST_CASE("Iterate select statement") { #endif #if __cpp_lib_containers_ranges >= 202202L -#if !defined(__clang__) || (__clang_major__ >= 15) +#ifdef SQLITE_ORM_CPP20_VIEWS_SUPPORTED SECTION("from range") { std::ranges::view auto view = db.iterate(select(object())); REQUIRE(std::vector{std::from_range, view} == expected_vec); diff --git a/tests/static_tests/function_static_tests.cpp b/tests/static_tests/function_static_tests.cpp index 59c3f73c..79cb5670 100644 --- a/tests/static_tests/function_static_tests.cpp +++ b/tests/static_tests/function_static_tests.cpp @@ -25,10 +25,7 @@ concept storage_aggregate_callable = requires(S& storage) { { storage.template delete_aggregate_function() }; }; -constexpr const int& clamp_int_ref(const int& v, const int& lo, const int& hi) { - return std::clamp(v, lo, hi); -} -constexpr auto clamp_int_ref_ptr = &clamp_int_ref; +constexpr auto clamp_int_ptr = &std::clamp; #endif TEST_CASE("function static") { @@ -348,12 +345,9 @@ TEST_CASE("function static") { } #endif SECTION("freestanding function") { -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - SKIP("GCC < 12 cannot use this function pointer as NTTP in this test."); -#else - constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); - using quoted_type = decltype("f"_scalar.quote(std::clamp)); - using expected_callable_type = decltype(&std::clamp); + constexpr auto quotedScalar = "f"_scalar.quote(clamp_int_ptr); + using quoted_type = decltype("f"_scalar.quote(clamp_int_ptr)); + using expected_callable_type = std::remove_cv_t; STATIC_REQUIRE(quotedScalar._nme[0] == 'f' && quotedScalar._nme[1] == '\0'); STATIC_REQUIRE(std::is_same_v); -#endif } SECTION("template function") { -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - SKIP("GCC < 12 cannot use this function pointer as NTTP in this test."); -#else - constexpr auto quotedScalar = "f"_scalar.quote(std::clamp); - using quoted_type = decltype("f"_scalar.quote(std::clamp)); - using expected_callable_type = decltype(&std::clamp); + constexpr auto quotedScalar = + "f"_scalar.quote(clamp_int_ptr); + using quoted_type = + decltype("f"_scalar.quote(clamp_int_ptr)); + using expected_callable_type = std::remove_cv_t; STATIC_REQUIRE(quotedScalar._nme[0] == 'f' && quotedScalar._nme[1] == '\0'); STATIC_REQUIRE(std::is_same_v); -#endif } SECTION("lambda") { constexpr auto lambda = [](unsigned long errcode) { diff --git a/tests/static_tests/iterator_t.cpp b/tests/static_tests/iterator_t.cpp index aeeee46c..76dce29d 100644 --- a/tests/static_tests/iterator_t.cpp +++ b/tests/static_tests/iterator_t.cpp @@ -179,11 +179,11 @@ TEST_CASE("can view and iterate mapped") { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED STATIC_REQUIRE(storage_iterate_mapped); -#if !defined(__clang__) || (__clang_major__ >= 15) +#ifdef SQLITE_ORM_CPP20_VIEWS_SUPPORTED STATIC_REQUIRE(storage_iterate_mapped_ref); #endif #ifdef SQLITE_ORM_WITH_CPP20_ALIASES -#if !defined(__clang__) || (__clang_major__ >= 15) +#ifdef SQLITE_ORM_CPP20_VIEWS_SUPPORTED STATIC_REQUIRE(storage_iterate_mapped_ref); #endif #endif @@ -196,7 +196,7 @@ TEST_CASE("can view and iterate mapped") { #endif } -#if defined(SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED) && (!defined(__clang__) || (__clang_major__ >= 15)) +#if defined(SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED) && defined(SQLITE_ORM_CPP20_VIEWS_SUPPORTED) TEST_CASE("can view and iterate result set") { struct Object {}; using empty_storage_type = decltype(make_storage("")); diff --git a/tests/user_defined_functions.cpp b/tests/user_defined_functions.cpp index 47bf1222..a6c963b0 100644 --- a/tests/user_defined_functions.cpp +++ b/tests/user_defined_functions.cpp @@ -523,6 +523,8 @@ TEST_CASE("custom functions") { inline int ERR_FATAL_ERROR(unsigned long errcode) { return errcode != 0; } +inline constexpr auto err_fatal_error_ptr = &ERR_FATAL_ERROR; +inline constexpr auto clamp_int_ptr = &std::clamp; struct noncopyable_scalar { int operator()(int x) const noexcept { @@ -569,10 +571,7 @@ TEST_CASE("generalized scalar udf") { storage.sync_schema(); SECTION("freestanding function") { -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - SKIP("GCC < 12 cannot use this function as NTTP in quoted scalar tests."); -#else - constexpr auto err_fatal_error_f = "ERR_FATAL_ERROR"_scalar.quote(ERR_FATAL_ERROR); + constexpr auto err_fatal_error_f = "ERR_FATAL_ERROR"_scalar.quote(err_fatal_error_ptr); storage.create_scalar_function(); { auto rows = storage.select(err_fatal_error_f(1)); @@ -580,7 +579,6 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); -#endif } SECTION("stateless lambda") { constexpr auto is_fatal_error_f = "is_fatal_error"_scalar.quote([](unsigned long errcode) { @@ -663,10 +661,7 @@ TEST_CASE("generalized scalar udf") { } #endif SECTION("specialized template function") { -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - SKIP("GCC < 12 cannot use std::clamp specialization as NTTP."); -#else - constexpr auto clamp_int_f = "clamp_int"_scalar.quote(std::clamp); + constexpr auto clamp_int_f = "clamp_int"_scalar.quote(clamp_int_ptr); storage.create_scalar_function(); { auto rows = storage.select(clamp_int_f(0, 1, 1)); @@ -674,14 +669,10 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); -#endif } SECTION("overloaded template function") { -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - SKIP("GCC < 12 cannot use std::clamp overload as NTTP."); -#else constexpr auto clamp_int_f = - "clamp_int"_scalar.quote(std::clamp); + "clamp_int"_scalar.quote(clamp_int_ptr); storage.create_scalar_function(); { auto rows = storage.select(clamp_int_f(0, 1, 1)); @@ -689,7 +680,6 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); -#endif } SECTION("non-copyable function object") { // note: unlike msvc, gcc+clang require a constant template parameter to be copyable (and probably rightly so); @@ -715,10 +705,7 @@ TEST_CASE("generalized scalar udf") { storage.delete_scalar_function(); } SECTION("escaped function identifier") { -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) - SKIP("GCC < 12 cannot use std::clamp specialization as NTTP."); -#else - constexpr auto clamp_f = R"("clamp int")"_scalar.quote(std::clamp); + constexpr auto clamp_f = R"("clamp int")"_scalar.quote(clamp_int_ptr); storage.create_scalar_function(); { auto rows = storage.select(clamp_f(0, 1, 1)); @@ -726,7 +713,6 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); -#endif } } #endif From 25e42df20823d5a6caeef0715c630022e54b80a1 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Tue, 28 Apr 2026 20:24:11 +0500 Subject: [PATCH 10/13] Restore gcc-11 fallback for quoted clamp static tests. Keep pointer-based clamp handling but skip the two NTTP-sensitive static sections on gcc<12 where std::clamp remains unsupported as a template argument. Made-with: Cursor --- tests/static_tests/function_static_tests.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/static_tests/function_static_tests.cpp b/tests/static_tests/function_static_tests.cpp index 79cb5670..598d9d74 100644 --- a/tests/static_tests/function_static_tests.cpp +++ b/tests/static_tests/function_static_tests.cpp @@ -345,6 +345,9 @@ TEST_CASE("function static") { } #endif SECTION("freestanding function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use this function pointer as NTTP in this test."); +#else constexpr auto quotedScalar = "f"_scalar.quote(clamp_int_ptr); using quoted_type = decltype("f"_scalar.quote(clamp_int_ptr)); using expected_callable_type = std::remove_cv_t; @@ -371,8 +374,12 @@ TEST_CASE("function static") { using storage_type = decltype(make_storage("")); STATIC_REQUIRE(storage_scalar_callable); +#endif } SECTION("template function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use this function pointer as NTTP in this test."); +#else constexpr auto quotedScalar = "f"_scalar.quote(clamp_int_ptr); using quoted_type = @@ -401,6 +408,7 @@ TEST_CASE("function static") { using storage_type = decltype(make_storage("")); STATIC_REQUIRE(storage_scalar_callable); +#endif } SECTION("lambda") { constexpr auto lambda = [](unsigned long errcode) { From b8d58020d76c8b30a09cfa9a3bd78365793d84c1 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Tue, 28 Apr 2026 23:48:29 +0500 Subject: [PATCH 11/13] Update user-defined function tests for GCC compatibility - Skip NTTP-sensitive sections for `std::clamp` in tests when using GCC versions below 12, ensuring compatibility with older compilers. - Adjusted function references to use direct function names instead of pointers for better clarity and maintainability in quoted scalar tests. --- include/sqlite_orm/sqlite_orm.h | 288 +++++++++++++++++++++++++++++-- tests/user_defined_functions.cpp | 26 ++- 2 files changed, 298 insertions(+), 16 deletions(-) diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index 05b5acce..20db3d3e 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -31,6 +31,7 @@ __pragma(push_macro("max")) // #include "cxx_universal.h" + /* * This header makes central C++ functionality on which sqlite_orm depends universally available: * - alternative operator representations @@ -53,6 +54,7 @@ using std::nullptr_t; // #include "cxx_check_prerequisites.h" + /* * This header detects missing core C++ language features on which sqlite_orm depends, bailing out with a hard error. */ @@ -74,6 +76,7 @@ using std::nullptr_t; // #include "cxx_core_features.h" + /* * This header detects core C++ language features. * May be updated/overwritten by cxx_compiler_quirks.h @@ -148,6 +151,7 @@ using std::nullptr_t; // #include "cxx_compiler_quirks.h" + /* * This header defines macros for circumventing compiler quirks on which sqlite_orm depends. * May amend cxx_core_features.h @@ -221,8 +225,14 @@ using std::nullptr_t; #define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS #endif +#if defined(SQLITE_ORM_CPP20_VIEWS_SUPPORTED) && (defined(__clang__) && (__clang_major__ <= 15)) +#undef SQLITE_ORM_CPP20_VIEWS_SUPPORTED +#endif + + // #include "platform_definitions.h" + #if defined(_WIN32) #define SQLITE_ORM_WIN @@ -261,8 +271,10 @@ using std::nullptr_t; // pull in SQLite3 configuration early, such that version and feature macros are globally available in sqlite_orm // #include "sqlite3_config.h" + #include + #ifdef BUILD_SQLITE_ORM_MODULE #define SQLITE_ORM_EXPORT export #else @@ -313,6 +325,10 @@ using std::nullptr_t; #define SQLITE_ORM_CPP20_RANGES_SUPPORTED #endif +#if __cpp_lib_ranges >= 202110L +#define SQLITE_ORM_CPP20_VIEWS_SUPPORTED +#endif + #if __cpp_lib_generator >= 202207L #define SQLITE_ORM_CPP23_GENERATOR_SUPPORTED #endif @@ -370,8 +386,10 @@ namespace sqlite_orm { #endif // #include "functional/cxx_optional.h" + // #include "cxx_core_features.h" + #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #elif __has_include() @@ -382,8 +400,10 @@ namespace sqlite_orm { #define SQLITE_ORM_OPTIONAL_SUPPORTED #endif + // #include "functional/cxx_type_traits_polyfill.h" + #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #else @@ -392,6 +412,7 @@ namespace sqlite_orm { // #include "mpl/conditional.h" + namespace sqlite_orm::internal::mpl { /* * Binary quoted metafunction equivalent to `std::conditional`, @@ -422,6 +443,7 @@ namespace sqlite_orm { namespace mpl = internal::mpl; } + namespace sqlite_orm::internal::polyfill { #if __cpp_lib_void_t >= 201411L using std::void_t; @@ -570,6 +592,7 @@ namespace sqlite_orm { // #include "functional/cxx_functional_polyfill.h" + #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #else @@ -584,12 +607,14 @@ namespace sqlite_orm { // #include "../member_traits/member_traits.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_function, std::true_type, std::false_type #endif // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { // SFINAE friendly trait to get a member object pointer's field type template @@ -687,6 +712,7 @@ namespace sqlite_orm::internal { using as_field_of_t = member_field_type_t O::*; } + namespace sqlite_orm::internal::polyfill { // C++20 or later (unfortunately there's no feature test macro). // Stupidly, clang says C++20, but `std::identity` was only implemented in libc++ 13 and libstd++-v3 10 @@ -782,6 +808,7 @@ namespace sqlite_orm { // #include "functional/gsl.h" + /** @file A subset of the Guidelines Support Library (GSL) as it is useful for this library. * * At the time of writing, the use of these symbols serves only to express the logical intention, because: @@ -867,6 +894,7 @@ namespace sqlite_orm { // #include "functional/mpl.h" + /* * Symbols for 'template metaprogramming' (compile-time template programming), * inspired by the MPL of Aleksey Gurtovoy and David Abrahams, and the Mp11 of Peter Dimov and Bjorn Reese. @@ -904,6 +932,7 @@ namespace sqlite_orm { // #include "mpl/conditional.h" + namespace sqlite_orm::internal::mpl { template class Fn> struct indirectly_test_metafunction; @@ -1396,10 +1425,12 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_traits.h" + // #include "../functional/cxx_type_traits_polyfill.h" // #include "../functional/mpl.h" + // convenience metafunction algorithms namespace sqlite_orm::internal { /* @@ -1452,6 +1483,7 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_filter.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::integral_constant, std::index_sequence, std::conditional, std::declval #include // std::tuple, std::tuple_cat, std::tuple_element @@ -1461,6 +1493,7 @@ namespace sqlite_orm::internal { // #include "../functional/index_sequence_util.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::index_sequence #endif @@ -1511,6 +1544,7 @@ namespace sqlite_orm::internal { using flatten_idxseq_t = typename flatten_idxseq::type; } + namespace sqlite_orm::internal { template using tuple_cat_t = decltype(std::tuple_cat(std::declval()...)); @@ -1596,6 +1630,7 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_transformer.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::remove_reference, std::common_type, std::index_sequence, std::make_index_sequence, std::forward, std::move, std::integral_constant, std::declval #include // std::tuple_size, std::get @@ -1608,6 +1643,7 @@ namespace sqlite_orm::internal { // #include "../functional/mpl.h" + namespace sqlite_orm::internal { template class Op> struct tuple_transformer; @@ -1743,6 +1779,7 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_iteration.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::get, std::tuple_element, std::tuple_size #include // std::index_sequence, std::make_index_sequence @@ -1810,6 +1847,7 @@ namespace sqlite_orm::internal { // #include "type_traits.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::is_empty, std::is_aggregate #if __cpp_lib_unwrap_ref >= 201811L @@ -1821,6 +1859,7 @@ namespace sqlite_orm::internal { // #include "functional/cxx_type_traits_polyfill.h" + // C++ generic traits used throughout the library namespace sqlite_orm::internal { template @@ -1958,6 +1997,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "alias.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same #include // std::make_index_sequence, std::move @@ -1974,6 +2014,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "functional/cstring_literal.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include // std::index_sequence @@ -2011,6 +2052,7 @@ namespace sqlite_orm::internal { // #include "alias_traits.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_base_of, std::is_same, std::remove_const #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -2022,6 +2064,7 @@ namespace sqlite_orm::internal { // #include "type_traits.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @short Base class for a custom table alias, column alias or expression alias. @@ -2180,6 +2223,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_of.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible, std::bool_constant #endif @@ -2188,6 +2232,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "member_traits/member_traits.h" + namespace sqlite_orm::internal { template struct column_pointer; @@ -2238,6 +2283,7 @@ namespace sqlite_orm::internal { // #include "table_type_of.h" + namespace sqlite_orm::internal { template struct column_pointer; @@ -2278,8 +2324,10 @@ namespace sqlite_orm::internal { // #include "tags.h" + // #include "functional/cxx_functional_polyfill.h" + namespace sqlite_orm::internal { struct negatable_t {}; @@ -2305,6 +2353,7 @@ namespace sqlite_orm::internal { // #include "column_pointer.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible, std::is_base_of #include // std::move @@ -2316,6 +2365,7 @@ namespace sqlite_orm::internal { // #include "table_reference.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::remove_const, std::type_identity #include // std::move @@ -2328,8 +2378,10 @@ namespace sqlite_orm::internal { // #include "literal.h" + // #include "functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { /* @@ -2349,6 +2401,7 @@ namespace sqlite_orm::internal { using is_literal = polyfill::bool_constant>; } + namespace sqlite_orm::internal { /* * Bound input arguments for eponymous virtual tables used in table-valued function calls. @@ -2388,7 +2441,7 @@ namespace sqlite_orm::internal { template constexpr SQLITE_ORM_STATIC_CALLOP table_valued_expression operator()(Args... arguments) SQLITE_ORM_OR_CONST_CALLOP { - return {{ {std::move(arguments)}... }}; + return {{{std::move(arguments)}...}}; } #endif }; @@ -2424,6 +2477,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "tags.h" + namespace sqlite_orm::internal { /** * This class is used to store explicit mapped type T and its column descriptor (member pointer/getter/setter). @@ -3048,6 +3102,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "error_code.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::error_code, std::system_error @@ -3218,6 +3273,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "type_printer.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::shared_ptr, std::unique_ptr @@ -3225,6 +3281,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { #endif // #include "functional/cxx_optional.h" + // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/gsl.h" @@ -3233,6 +3290,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "is_std_ptr.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include @@ -3265,6 +3323,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { }; } + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -3339,6 +3398,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "constraints.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_base_of, std::false_type, std::true_type #include // std::system_error @@ -3353,6 +3413,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "tuple_helper/same_or_void.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::common_type #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -3415,6 +3476,7 @@ namespace sqlite_orm::internal { // #include "collate_argument.h" + namespace sqlite_orm::internal { enum class collate_argument { binary, @@ -3431,6 +3493,7 @@ namespace sqlite_orm::internal { // #include "type_printer.h" + namespace sqlite_orm::internal { enum class conflict_clause_t { rollback, @@ -4173,6 +4236,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_printer.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::stringstream @@ -4192,6 +4256,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "type_traits.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -4348,6 +4413,7 @@ namespace sqlite_orm { // #include "rowid.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -4417,6 +4483,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "operators.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move @@ -4428,10 +4495,13 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "serialize_result_type.h" + // #include "functional/cxx_string_view.h" + // #include "cxx_core_features.h" + #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #elif __has_include() @@ -4450,6 +4520,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "functional/gsl.h" + namespace sqlite_orm::internal { #ifdef SQLITE_ORM_STRING_VIEW_SUPPORTED using serialize_result_type = std::string_view; @@ -4462,6 +4533,7 @@ namespace sqlite_orm::internal { #endif } + namespace sqlite_orm::internal { template struct binary_operator : Ds... { @@ -4751,6 +4823,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "select_constraints.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include @@ -4762,10 +4835,12 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { #endif // #include "functional/cxx_optional.h" + // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/is_base_template_of.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::declval #endif @@ -4809,6 +4884,7 @@ namespace sqlite_orm::internal { // #include "optional_container.h" + namespace sqlite_orm::internal { /** * This is a cute class which allows storing something or nothing @@ -4839,6 +4915,7 @@ namespace sqlite_orm::internal { // #include "ast/where.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move @@ -4848,6 +4925,7 @@ namespace sqlite_orm::internal { // #include "../serialize_result_type.h" + namespace sqlite_orm::internal { struct where_string { serialize_result_type serialize() const { @@ -4894,6 +4972,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/group_by.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple, std::make_tuple #include // std::true_type, std::false_type @@ -4902,6 +4981,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { template struct group_by_with_having { @@ -4945,6 +5025,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/limit.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #include // std::true_type, std::false_type @@ -4956,8 +5037,10 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "offset.h" + // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { /** * Stores OFFSET only info @@ -4984,6 +5067,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } + namespace sqlite_orm::internal { /** * Stores LIMIT/OFFSET info @@ -5040,6 +5124,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "core_functions.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::make_tuple, std::tuple_size @@ -5058,6 +5143,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "conditions.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::enable_if, std::is_same, std::remove_const @@ -5082,6 +5168,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "serializer_context.h" + namespace sqlite_orm::internal { struct serializer_context_base { bool replace_bindable_with_question = false; @@ -5110,6 +5197,7 @@ namespace sqlite_orm::internal { // #include "expression.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include // std::enable_if @@ -5117,12 +5205,14 @@ namespace sqlite_orm::internal { #endif // #include "functional/cxx_optional.h" + // #include "functional/cxx_type_traits_polyfill.h" // #include "tags.h" // #include "operators.h" + namespace sqlite_orm::internal { template struct in_t; @@ -5224,6 +5314,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/cross_join.h" // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { /** * CROSS JOIN holder. @@ -5246,6 +5337,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } + namespace sqlite_orm::internal { /** * Collated something @@ -6308,6 +6400,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_traits.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -6321,6 +6414,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_of.h" + namespace sqlite_orm::internal { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED template @@ -6350,10 +6444,12 @@ namespace sqlite_orm::internal { // #include "ast/into.h" + // #include "../functional/cxx_type_traits_polyfill.h" // #include "../table_reference.h" + namespace sqlite_orm::internal { template struct into_t { @@ -6380,6 +6476,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/window.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::tuple @@ -6389,6 +6486,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { struct unbounded_preceding_t {}; @@ -6588,6 +6686,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_of.h" + namespace sqlite_orm::internal { template struct unique_ptr_result_of {}; @@ -8809,6 +8908,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "cte_moniker.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #ifdef SQLITE_ORM_WITH_CPP20_ALIASES @@ -8825,6 +8925,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "alias.h" + #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) namespace sqlite_orm::internal { /** @@ -8900,6 +9001,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "schema/column.h" + #include // sqlite_int64 #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple @@ -8921,14 +9023,17 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../type_is_nullable.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::false_type, std::true_type, std::enable_if #include // std::shared_ptr, std::unique_ptr #endif // #include "functional/cxx_optional.h" + // #include "functional/cxx_type_traits_polyfill.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -8964,6 +9069,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../constraints.h" + namespace sqlite_orm::internal { struct column_identifier { @@ -9229,6 +9335,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } + namespace sqlite_orm::internal { #ifdef SQLITE_ORM_OPTIONAL_SUPPORTED template @@ -10036,6 +10143,7 @@ namespace sqlite_orm::internal { // #include "statement_binder.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_arithmetic, std::is_same, std::make_index_sequence, std::index_sequence @@ -10057,7 +10165,7 @@ namespace sqlite_orm::internal { // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/cxx_functional_polyfill.h" -// std::invoke + // std::invoke // #include "is_std_ptr.h" // #include "tuple_helper/tuple_filter.h" @@ -10068,12 +10176,14 @@ namespace sqlite_orm::internal { // #include "arithmetic_tag.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_integral #endif // #include "functional/mpl/conditional.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -10094,6 +10204,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "xdestroy_handling.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::integral_constant #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -10105,6 +10216,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "functional/gsl.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { using xdestroy_fn_t = void (*)(void*); @@ -10343,6 +10455,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "pointer_value.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3020000 #include @@ -10360,6 +10473,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "xdestroy_handling.h" + #if SQLITE_VERSION_NUMBER >= 3020000 namespace sqlite_orm::internal { #ifdef SQLITE_ORM_WITH_CPP20_ALIASES @@ -10647,6 +10761,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } #endif + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -10996,6 +11111,7 @@ namespace sqlite_orm::internal { // #include "column_result.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic, std::is_base_of #include // std::reference_wrapper @@ -11011,6 +11127,7 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_fy.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #endif @@ -11041,6 +11158,7 @@ namespace sqlite_orm::internal { // #include "mapped_type_proxy.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::remove_const #endif @@ -11053,6 +11171,7 @@ namespace sqlite_orm::internal { // #include "alias_traits.h" + namespace sqlite_orm::internal { /** * Defines the `type` typename to be: @@ -11089,6 +11208,7 @@ namespace sqlite_orm::internal { // #include "column_result_proxy.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #endif @@ -11101,6 +11221,7 @@ namespace sqlite_orm::internal { // #include "table_reference.h" + namespace sqlite_orm::internal { /* * Holder for the type of an unmapped aggregate/structure/object to be constructed ad-hoc from column results. @@ -11142,6 +11263,7 @@ namespace sqlite_orm::internal { // #include "cte_types.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include @@ -11150,6 +11272,7 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_fy.h" + #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) namespace sqlite_orm::internal { /** @@ -11199,6 +11322,7 @@ namespace sqlite_orm::internal { // #include "storage_traits.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple #endif @@ -11213,6 +11337,7 @@ namespace sqlite_orm::internal { // #include "storage_lookup.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::remove_const, std::enable_if, std::is_base_of, std::is_void #include // std::tuple_size, std::get @@ -11223,6 +11348,7 @@ namespace sqlite_orm::internal { // #include "type_traits.h" + namespace sqlite_orm::internal { template struct storage_t; @@ -11361,6 +11487,7 @@ namespace sqlite_orm::internal { // #include "schema/column.h" + namespace sqlite_orm::internal::storage_traits { /** * DBO - db object (table) @@ -11404,6 +11531,7 @@ namespace sqlite_orm::internal::storage_traits { // #include "function.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_member_function_pointer, std::is_function, std::remove_const, std::decay, std::is_convertible, std::is_same, std::false_type, std::true_type, std::is_pointer #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -11421,10 +11549,12 @@ namespace sqlite_orm::internal::storage_traits { // #include "functional/function_traits.h" + // #include "cxx_type_traits_polyfill.h" // #include "mpl.h" + namespace sqlite_orm::internal { /* * Define nested typenames: @@ -11503,6 +11633,7 @@ namespace sqlite_orm::internal { // #include "tags.h" + // export forward-declarations SQLITE_ORM_EXPORT namespace sqlite_orm { struct arg_values; @@ -12068,6 +12199,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/special_keywords.h" + namespace sqlite_orm::internal { struct current_time_t {}; struct current_date_t {}; @@ -12089,6 +12221,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/cast.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // SQLITE_ORM_IMPORT_STD_MODULE @@ -12122,6 +12255,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/in.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::initializer_list #include // std::tuple @@ -12131,6 +12265,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../tags.h" + namespace sqlite_orm::internal { struct in_base { @@ -12237,11 +12372,13 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/between.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // #include "tags.h" + namespace sqlite_orm::internal { /** * BETWEEN operator object. @@ -12273,6 +12410,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/is_null.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif @@ -12281,6 +12419,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/config.h" + namespace sqlite_orm::internal { /** * IS NULL operator object. @@ -12308,6 +12447,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/is_not_null.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif @@ -12316,6 +12456,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/config.h" + namespace sqlite_orm::internal { /** * IS NOT NULL operator object. @@ -12346,12 +12487,14 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/rank.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::forward #endif // #include "window.h" + namespace sqlite_orm::internal { struct rank_t { template @@ -12373,6 +12516,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "window_functions.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple #include // std::forward, std::move @@ -12380,6 +12524,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/window.h" + namespace sqlite_orm::internal { struct row_number_t { @@ -12602,6 +12747,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } + namespace sqlite_orm::internal { /** * Obtains the result type of expressions that form the columns of a select statement. @@ -13000,6 +13146,7 @@ namespace sqlite_orm::internal { // #include "sync_schema_result.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #endif @@ -13073,6 +13220,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "table_info.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::move @@ -13125,6 +13273,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_impl.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -13147,6 +13296,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "schema/table.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::remove_const, std::true_type, std::false_type @@ -13171,6 +13321,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "table_base.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_member_pointer, std::remove_cvref #include // std::string @@ -13197,6 +13348,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "column.h" + namespace sqlite_orm::internal { struct table_identifier { @@ -13459,6 +13611,7 @@ namespace sqlite_orm::internal { // #include "index.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple, std::make_tuple, std::declval, std::tuple_element_t #include // std::string @@ -13469,6 +13622,7 @@ namespace sqlite_orm::internal { // #include "../indexed_column.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::move @@ -13476,6 +13630,7 @@ namespace sqlite_orm::internal { // #include "ast/where.h" + namespace sqlite_orm::internal { template struct indexed_column_t { @@ -13533,6 +13688,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_type_of.h" + namespace sqlite_orm::internal { struct index_base { std::string name; @@ -13580,6 +13736,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } + namespace sqlite_orm::internal { template using is_base_table_element_or_constraint = mpl::invoke_t, @@ -13732,6 +13889,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" + // interface functions namespace sqlite_orm::internal { template @@ -13838,6 +13996,7 @@ namespace sqlite_orm::internal { // #include "journal_mode.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::array #include // std::string @@ -13848,6 +14007,7 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" + #if defined(_WINNT_) // DELETE is a macro defined in the Windows SDK (winnt.h) #pragma push_macro("DELETE") @@ -13927,6 +14087,7 @@ namespace sqlite_orm::internal { // #include "mapped_view.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include // std::forward, std::move @@ -13934,6 +14095,7 @@ namespace sqlite_orm::internal { // #include "row_extractor.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if_t, std::is_arithmetic, std::is_same, std::enable_if @@ -13968,6 +14130,7 @@ namespace sqlite_orm::internal { // #include "locking_mode.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::array #include // std::string @@ -13978,6 +14141,7 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { enum class locking_mode : signed char { NORMAL = 0, @@ -14031,6 +14195,7 @@ namespace sqlite_orm::internal { // #include "type_traits.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -14561,6 +14726,7 @@ namespace sqlite_orm::internal { // #include "mapped_iterator.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::shared_ptr, std::make_shared @@ -14572,6 +14738,7 @@ namespace sqlite_orm::internal { // #include "statement_finalizer.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::unique_ptr @@ -14605,6 +14772,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "object_from_column_builder.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_member_object_pointer @@ -14623,6 +14791,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" + namespace sqlite_orm::internal { struct object_from_column_builder_base { sqlite3_stmt* stmt = nullptr; @@ -14687,6 +14856,7 @@ namespace sqlite_orm::internal { // #include "util.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string @@ -14700,6 +14870,7 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -14896,6 +15067,7 @@ namespace sqlite_orm::internal { }; } + namespace sqlite_orm::internal { /* * (Legacy) Input iterator over a result set for a mapped object. @@ -14994,6 +15166,7 @@ namespace sqlite_orm::internal { // #include "ast_iterator.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_invocable #include // std::vector @@ -15001,7 +15174,7 @@ namespace sqlite_orm::internal { #endif // #include "functional/cxx_functional_polyfill.h" -// std::is_invocable + // std::is_invocable // #include "tuple_helper/tuple_iteration.h" // #include "type_traits.h" @@ -15018,6 +15191,7 @@ namespace sqlite_orm::internal { // #include "prepared_statement.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::unique_ptr @@ -15039,6 +15213,7 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::atomic_int, memory order flags @@ -15051,6 +15226,7 @@ namespace sqlite_orm::internal { // #include "functional/cxx_new.h" + #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #else @@ -15073,6 +15249,7 @@ namespace sqlite_orm { // #include "functional/cxx_scope_guard.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::forward #endif @@ -15101,8 +15278,10 @@ namespace sqlite_orm::internal { // #include "vfs_name.h" + // #include "serialize_result_type.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { #ifdef SQLITE_ORM_UNIX @@ -15125,6 +15304,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "db_open_mode.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { enum class db_open_mode { @@ -15149,6 +15329,7 @@ namespace sqlite_orm::internal { // #include "storage_options.h" + #include #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include @@ -15160,6 +15341,7 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" + namespace sqlite_orm::internal { template using storage_opt_tag_t = typename T::storage_opt_tag; @@ -15217,6 +15399,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } + namespace sqlite_orm::internal { struct db_arguments { db_arguments(std::string filename, const connection_control& connectionCtrl = {}) : @@ -15503,6 +15686,7 @@ namespace sqlite_orm::internal { // #include "values.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::vector #include // std::tuple @@ -15511,6 +15695,7 @@ namespace sqlite_orm::internal { // #include "functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { template struct values_t { @@ -15549,6 +15734,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/upsert_clause.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3024000 #include // std::tuple @@ -15558,6 +15744,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm::internal { #if SQLITE_VERSION_NUMBER >= 3024000 template @@ -15625,6 +15812,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/set.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple, std::tuple_size #include // std::string @@ -15637,6 +15825,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_name_collector.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::set #include // std::string @@ -15657,6 +15846,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" + namespace sqlite_orm::internal { struct table_name_collector_base { using table_name_set = std::set>; @@ -15734,6 +15924,7 @@ namespace sqlite_orm::internal { }; } + namespace sqlite_orm::internal { template void iterate_ast(const T& t, L&& lambda); @@ -15831,6 +16022,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } + namespace sqlite_orm::internal { struct prepared_statement_base { orm_gsl::owner stmt = nullptr; @@ -16706,6 +16898,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/excluded.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif @@ -16736,12 +16929,14 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/exists.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // #include "../tags.h" + namespace sqlite_orm::internal { template struct exists_t : condition_t, negatable_t { @@ -16773,12 +16968,14 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/match.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // #include "../type_traits.h" + namespace sqlite_orm::internal { template struct match_with_table_t { @@ -16839,6 +17036,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "window_functions.h" + namespace sqlite_orm::internal { /** * ast_iterator accepts any expression and a callable object @@ -17705,6 +17903,7 @@ namespace sqlite_orm::internal { // #include "util.h" + namespace sqlite_orm::internal { /** * A C++ view over a result set of objects mapped as tables, returned by `storage_t::iterate<>()`. @@ -17754,6 +17953,7 @@ inline constexpr bool std::ranges::enable_borrowed_range #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move, std::remove_cvref @@ -17769,6 +17969,7 @@ inline constexpr bool std::ranges::enable_borrowed_range #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move @@ -17784,6 +17985,7 @@ inline constexpr bool std::ranges::enable_borrowed_range @@ -17874,6 +18076,7 @@ namespace sqlite_orm::internal { // #include "storage_lookup.h" + namespace sqlite_orm::internal { /* * A C++ view over a result set of a select statement, returned by `storage_t::iterate()`. @@ -17942,6 +18145,7 @@ inline constexpr bool std::ranges::enable_borrowed_range #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // atoi @@ -17961,6 +18165,7 @@ inline constexpr bool std::ranges::enable_borrowed_range #else @@ -17971,7 +18176,7 @@ inline constexpr bool std::ranges::enable_borrowed_range= 201603L @@ -17993,11 +18198,12 @@ namespace sqlite_orm::internal::polyfill { namespace sqlite_orm { namespace polyfill = internal::polyfill; } -// std::apply + // std::apply // #include "tuple_helper/tuple_iteration.h" // #include "pragma.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string @@ -18024,6 +18230,7 @@ namespace sqlite_orm { // #include "serializing_util.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::index_sequence, std::remove_cvref #include @@ -18034,7 +18241,7 @@ namespace sqlite_orm { #endif // #include "functional/cxx_type_traits_polyfill.h" -// std::remove_cvref, polyfill::is_detected + // std::remove_cvref, polyfill::is_detected // #include "functional/cxx_functional_polyfill.h" // #include "functional/gsl.h" @@ -18053,6 +18260,7 @@ namespace sqlite_orm { // #include "schema/column.h" + namespace sqlite_orm::internal { template struct order_by_t; @@ -18496,6 +18704,7 @@ namespace sqlite_orm::internal { } } + namespace sqlite_orm::internal { struct storage_base; struct sqlite_executor; @@ -18759,6 +18968,7 @@ namespace sqlite_orm::internal { // #include "limit_accessor.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::map @@ -18768,6 +18978,7 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" + namespace sqlite_orm::internal { struct limit_accessor { limit_accessor(std::unique_ptr& connection) : connection{connection} {} @@ -18896,6 +19107,7 @@ namespace sqlite_orm::internal { // #include "transaction_guard.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::function #include // std::move @@ -18903,6 +19115,7 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" + namespace sqlite_orm::internal { /** * Class used as a guard for a transaction. Calls `ROLLBACK` in destructor. @@ -18979,6 +19192,7 @@ namespace sqlite_orm::internal { // #include "backup.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::system_error @@ -18991,6 +19205,7 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" + namespace sqlite_orm::internal { /** * A backup class. Don't construct it as is, call storage.make_backup_from or storage.make_backup_to instead. @@ -19054,6 +19269,7 @@ namespace sqlite_orm::internal { // #include "values_to_tuple.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::index_sequence, std::make_index_sequence @@ -19064,12 +19280,14 @@ namespace sqlite_orm::internal { // #include "arg_values.h" + #include // #include "error_code.h" // #include "row_extractor.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** @short Wrapper around a dynamically typed value object. @@ -19215,6 +19433,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { }; } + namespace sqlite_orm::internal { template @@ -19254,6 +19473,7 @@ namespace sqlite_orm::internal { // #include "udf_proxy.h" + #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // assert macro @@ -19267,6 +19487,7 @@ namespace sqlite_orm::internal { // #include "error_code.h" + namespace sqlite_orm::internal { /* * Returns properly allocated memory space for the specified application-defined function object @@ -19485,6 +19706,7 @@ namespace sqlite_orm::internal { // #include "storage_options.h" + namespace sqlite_orm::internal { struct storage_base { public: @@ -20609,6 +20831,7 @@ namespace sqlite_orm::internal { // #include "expression_object_type.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::decay, std::remove_reference #include // std::reference_wrapper @@ -20618,6 +20841,7 @@ namespace sqlite_orm::internal { // #include "prepared_statement.h" + namespace sqlite_orm::internal { template struct expression_object_type; @@ -20724,6 +20948,7 @@ namespace sqlite_orm::internal { // #include "statement_serializer.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::remove_pointer, std::remove_reference, std::remove_cvref, std::disjunction #include // std::stringstream @@ -20744,14 +20969,16 @@ namespace sqlite_orm::internal { // #include "functional/cxx_optional.h" + // #include "functional/cxx_type_traits_polyfill.h" -// std::remove_cvref, std::disjunction + // std::remove_cvref, std::disjunction // #include "functional/cxx_functional_polyfill.h" -// std::identity, std::invoke + // std::identity, std::invoke // #include "functional/gsl.h" // #include "functional/always_default.h" + namespace sqlite_orm::internal { /* * Function object whose variadic call operator always returns the default constructed value of its template parameter type. @@ -20824,6 +21051,7 @@ namespace sqlite_orm::internal { // #include "column_names_getter.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_base_of #include // std::string @@ -20846,11 +21074,12 @@ namespace sqlite_orm::internal { // #include "select_constraints.h" // #include "storage_lookup.h" -// pick_table + // pick_table // #include "serializer_context.h" // #include "util.h" + namespace sqlite_orm::internal { template auto serialize(const T& t, const Ctx& context); @@ -20958,6 +21187,7 @@ namespace sqlite_orm::internal { // #include "cte_column_names_collector.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include // std::to_string @@ -20979,6 +21209,7 @@ namespace sqlite_orm::internal { // #include "select_constraints.h" + #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) namespace sqlite_orm::internal { // collecting column names utilizes the statement serializer @@ -21188,6 +21419,7 @@ namespace sqlite_orm::internal { // #include "order_by_serializer.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include // std::string @@ -21197,6 +21429,7 @@ namespace sqlite_orm::internal { // #include "functional/gsl.h" + namespace sqlite_orm::internal { template struct order_by_serializer; @@ -21281,6 +21514,7 @@ namespace sqlite_orm::internal { // #include "schema/triggers.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include @@ -21290,6 +21524,7 @@ namespace sqlite_orm::internal { // #include "../optional_container.h" + // NOTE Idea : Maybe also implement a custom trigger system to call a c++ callback when a trigger triggers ? // (Could be implemented with a normal trigger that insert or update an internal table and then retreive // the event in the C++ code, to call the C++ user callback, with update hooks: https://www.sqlite.org/c3ref/update_hook.html) @@ -21568,6 +21803,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "schema/virtual_table.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include // std::convertible_to @@ -21591,6 +21827,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "column.h" + namespace sqlite_orm::internal { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED template @@ -21725,6 +21962,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { #endif } + namespace sqlite_orm::internal { template struct statement_serializer; @@ -23457,7 +23695,7 @@ namespace sqlite_orm::internal { const Ctx&) SQLITE_ORM_OR_CONST_CALLOP { std::stringstream ss; ss << "SET "; -#if defined(SQLITE_ORM_CPP20_RANGES_SUPPORTED) && (!defined(__clang__) || (__clang_major__ >= 15)) +#ifdef SQLITE_ORM_CPP20_VIEWS_SUPPORTED ss << streaming_serialized(statement | std::views::transform(&dynamic_set_entry::serialized_value)); #else int index = 0; @@ -24541,6 +24779,7 @@ namespace sqlite_orm::internal { // #include "cte_storage.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include // std::remove_const @@ -24568,6 +24807,7 @@ namespace sqlite_orm::internal { // #include "column_expression.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic #include // std::tuple @@ -24586,6 +24826,7 @@ namespace sqlite_orm::internal { // #include "storage_traits.h" + namespace sqlite_orm::internal { template struct column_expression_type; @@ -24680,6 +24921,7 @@ namespace sqlite_orm::internal { // #include "storage_lookup.h" + namespace sqlite_orm::internal { #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) // F = field_type @@ -25008,8 +25250,10 @@ namespace sqlite_orm::internal { // #include "udf_existence_checker.h" + // #include "functional/cxx_string_view.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::ranges::find #endif @@ -25024,6 +25268,7 @@ namespace sqlite_orm::internal { // #include "storage_base.h" + namespace sqlite_orm::internal { #ifdef SQLITE_ORM_STRING_VIEW_SUPPORTED /* @@ -25076,6 +25321,7 @@ namespace sqlite_orm::internal { #endif } + namespace sqlite_orm::internal { /* * Implementation note: the technique of indirect expression testing is because @@ -26882,6 +27128,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { * this file is also used to provide definitions of interface methods 'hitting the database'. */ + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::make_unique #endif @@ -26890,6 +27137,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../default_value_extractor.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -26900,6 +27148,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" + namespace sqlite_orm::internal { template auto serialize(const T& t, const Ctx& context); @@ -26917,6 +27166,7 @@ namespace sqlite_orm::internal { // #include "../schema/column.h" + namespace sqlite_orm::internal { template std::unique_ptr column_constraints::default_value() const { @@ -26937,6 +27187,7 @@ namespace sqlite_orm::internal { * this file is also used to provide definitions of interface methods 'hitting the database'. */ + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::remove_reference #include // std::move @@ -26953,6 +27204,7 @@ namespace sqlite_orm::internal { // #include "../schema/table.h" + namespace sqlite_orm::internal { template std::vector base_table::get_table_info() const { @@ -27007,6 +27259,7 @@ namespace sqlite_orm::internal { * this file is also used to separate implementation details from the main header file. */ + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_same #include // std::stringstream @@ -27019,6 +27272,7 @@ namespace sqlite_orm::internal { // #include "../sqlite_schema_table.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -27031,6 +27285,7 @@ namespace sqlite_orm::internal { // #include "alias.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { /** * SQLite's "schema table" that stores the schema for a database. @@ -27080,6 +27335,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../storage.h" + namespace sqlite_orm::internal { template template> @@ -27237,6 +27493,7 @@ namespace sqlite_orm::internal { // #include "node_tuple.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if #include // std::tuple @@ -27292,6 +27549,7 @@ namespace sqlite_orm::internal { // #include "window_functions.h" + namespace sqlite_orm::internal { template struct node_tuple { @@ -27613,6 +27871,7 @@ namespace sqlite_orm::internal { // #include "expression_object_type.h" + SQLITE_ORM_EXPORT namespace sqlite_orm { template @@ -27774,6 +28033,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "dbstat.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ENABLE_DBSTAT_VTAB #include // std::false_type, std::true_type, std::is_convertible @@ -27797,6 +28057,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_reference.h" + #ifdef SQLITE_ENABLE_DBSTAT_VTAB namespace sqlite_orm::internal { struct dbstat_module_tag { @@ -27919,6 +28180,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "generate_series.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3008012 #include // std::tuple_element, std::make_tuple @@ -27934,6 +28196,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_reference.h" + #if SQLITE_VERSION_NUMBER >= 3008012 namespace sqlite_orm::internal { struct generate_series_module_tag { @@ -28019,6 +28282,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "fts5.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3009000 || defined(SQLITE_ORM_ENABLE_FTS5) #include // std::tuple_size, std::make_tuple, std::get @@ -28041,6 +28305,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../constraints.h" + #if SQLITE_VERSION_NUMBER >= 3009000 || defined(SQLITE_ORM_ENABLE_FTS5) namespace sqlite_orm::internal { template @@ -28169,6 +28434,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "rtree.h" + #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ENABLE_RTREE #include // std::is_same @@ -28190,6 +28456,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../schema/column.h" + #ifdef SQLITE_ENABLE_RTREE namespace sqlite_orm::internal { template @@ -28273,6 +28540,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "pointer_value.h" + #if SQLITE_VERSION_NUMBER >= 3020000 SQLITE_ORM_EXPORT namespace sqlite_orm { diff --git a/tests/user_defined_functions.cpp b/tests/user_defined_functions.cpp index a6c963b0..47bf1222 100644 --- a/tests/user_defined_functions.cpp +++ b/tests/user_defined_functions.cpp @@ -523,8 +523,6 @@ TEST_CASE("custom functions") { inline int ERR_FATAL_ERROR(unsigned long errcode) { return errcode != 0; } -inline constexpr auto err_fatal_error_ptr = &ERR_FATAL_ERROR; -inline constexpr auto clamp_int_ptr = &std::clamp; struct noncopyable_scalar { int operator()(int x) const noexcept { @@ -571,7 +569,10 @@ TEST_CASE("generalized scalar udf") { storage.sync_schema(); SECTION("freestanding function") { - constexpr auto err_fatal_error_f = "ERR_FATAL_ERROR"_scalar.quote(err_fatal_error_ptr); +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use this function as NTTP in quoted scalar tests."); +#else + constexpr auto err_fatal_error_f = "ERR_FATAL_ERROR"_scalar.quote(ERR_FATAL_ERROR); storage.create_scalar_function(); { auto rows = storage.select(err_fatal_error_f(1)); @@ -579,6 +580,7 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } SECTION("stateless lambda") { constexpr auto is_fatal_error_f = "is_fatal_error"_scalar.quote([](unsigned long errcode) { @@ -661,7 +663,10 @@ TEST_CASE("generalized scalar udf") { } #endif SECTION("specialized template function") { - constexpr auto clamp_int_f = "clamp_int"_scalar.quote(clamp_int_ptr); +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use std::clamp specialization as NTTP."); +#else + constexpr auto clamp_int_f = "clamp_int"_scalar.quote(std::clamp); storage.create_scalar_function(); { auto rows = storage.select(clamp_int_f(0, 1, 1)); @@ -669,10 +674,14 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } SECTION("overloaded template function") { +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use std::clamp overload as NTTP."); +#else constexpr auto clamp_int_f = - "clamp_int"_scalar.quote(clamp_int_ptr); + "clamp_int"_scalar.quote(std::clamp); storage.create_scalar_function(); { auto rows = storage.select(clamp_int_f(0, 1, 1)); @@ -680,6 +689,7 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } SECTION("non-copyable function object") { // note: unlike msvc, gcc+clang require a constant template parameter to be copyable (and probably rightly so); @@ -705,7 +715,10 @@ TEST_CASE("generalized scalar udf") { storage.delete_scalar_function(); } SECTION("escaped function identifier") { - constexpr auto clamp_f = R"("clamp int")"_scalar.quote(clamp_int_ptr); +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 12) + SKIP("GCC < 12 cannot use std::clamp specialization as NTTP."); +#else + constexpr auto clamp_f = R"("clamp int")"_scalar.quote(std::clamp); storage.create_scalar_function(); { auto rows = storage.select(clamp_f(0, 1, 1)); @@ -713,6 +726,7 @@ TEST_CASE("generalized scalar udf") { REQUIRE(rows == expected); } storage.delete_scalar_function(); +#endif } } #endif From a6f2fbb0c98074e6d921582294180dafd3d5e5e2 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Tue, 28 Apr 2026 23:50:15 +0500 Subject: [PATCH 12/13] Remove unnecessary blank lines in sqlite_orm.h for improved readability and maintainability. --- include/sqlite_orm/sqlite_orm.h | 278 ++------------------------------ 1 file changed, 9 insertions(+), 269 deletions(-) diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index 20db3d3e..6d00cd3f 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -31,7 +31,6 @@ __pragma(push_macro("max")) // #include "cxx_universal.h" - /* * This header makes central C++ functionality on which sqlite_orm depends universally available: * - alternative operator representations @@ -54,7 +53,6 @@ using std::nullptr_t; // #include "cxx_check_prerequisites.h" - /* * This header detects missing core C++ language features on which sqlite_orm depends, bailing out with a hard error. */ @@ -76,7 +74,6 @@ using std::nullptr_t; // #include "cxx_core_features.h" - /* * This header detects core C++ language features. * May be updated/overwritten by cxx_compiler_quirks.h @@ -151,7 +148,6 @@ using std::nullptr_t; // #include "cxx_compiler_quirks.h" - /* * This header defines macros for circumventing compiler quirks on which sqlite_orm depends. * May amend cxx_core_features.h @@ -229,10 +225,8 @@ using std::nullptr_t; #undef SQLITE_ORM_CPP20_VIEWS_SUPPORTED #endif - // #include "platform_definitions.h" - #if defined(_WIN32) #define SQLITE_ORM_WIN @@ -271,10 +265,8 @@ using std::nullptr_t; // pull in SQLite3 configuration early, such that version and feature macros are globally available in sqlite_orm // #include "sqlite3_config.h" - #include - #ifdef BUILD_SQLITE_ORM_MODULE #define SQLITE_ORM_EXPORT export #else @@ -386,10 +378,8 @@ namespace sqlite_orm { #endif // #include "functional/cxx_optional.h" - // #include "cxx_core_features.h" - #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #elif __has_include() @@ -400,10 +390,8 @@ namespace sqlite_orm { #define SQLITE_ORM_OPTIONAL_SUPPORTED #endif - // #include "functional/cxx_type_traits_polyfill.h" - #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #else @@ -412,7 +400,6 @@ namespace sqlite_orm { // #include "mpl/conditional.h" - namespace sqlite_orm::internal::mpl { /* * Binary quoted metafunction equivalent to `std::conditional`, @@ -443,7 +430,6 @@ namespace sqlite_orm { namespace mpl = internal::mpl; } - namespace sqlite_orm::internal::polyfill { #if __cpp_lib_void_t >= 201411L using std::void_t; @@ -592,7 +578,6 @@ namespace sqlite_orm { // #include "functional/cxx_functional_polyfill.h" - #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #else @@ -607,14 +592,12 @@ namespace sqlite_orm { // #include "../member_traits/member_traits.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_function, std::true_type, std::false_type #endif // #include "../functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { // SFINAE friendly trait to get a member object pointer's field type template @@ -712,7 +695,6 @@ namespace sqlite_orm::internal { using as_field_of_t = member_field_type_t O::*; } - namespace sqlite_orm::internal::polyfill { // C++20 or later (unfortunately there's no feature test macro). // Stupidly, clang says C++20, but `std::identity` was only implemented in libc++ 13 and libstd++-v3 10 @@ -808,7 +790,6 @@ namespace sqlite_orm { // #include "functional/gsl.h" - /** @file A subset of the Guidelines Support Library (GSL) as it is useful for this library. * * At the time of writing, the use of these symbols serves only to express the logical intention, because: @@ -894,7 +875,6 @@ namespace sqlite_orm { // #include "functional/mpl.h" - /* * Symbols for 'template metaprogramming' (compile-time template programming), * inspired by the MPL of Aleksey Gurtovoy and David Abrahams, and the Mp11 of Peter Dimov and Bjorn Reese. @@ -932,7 +912,6 @@ namespace sqlite_orm { // #include "mpl/conditional.h" - namespace sqlite_orm::internal::mpl { template class Fn> struct indirectly_test_metafunction; @@ -1425,12 +1404,10 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_traits.h" - // #include "../functional/cxx_type_traits_polyfill.h" // #include "../functional/mpl.h" - // convenience metafunction algorithms namespace sqlite_orm::internal { /* @@ -1483,7 +1460,6 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_filter.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::integral_constant, std::index_sequence, std::conditional, std::declval #include // std::tuple, std::tuple_cat, std::tuple_element @@ -1493,7 +1469,6 @@ namespace sqlite_orm::internal { // #include "../functional/index_sequence_util.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::index_sequence #endif @@ -1544,7 +1519,6 @@ namespace sqlite_orm::internal { using flatten_idxseq_t = typename flatten_idxseq::type; } - namespace sqlite_orm::internal { template using tuple_cat_t = decltype(std::tuple_cat(std::declval()...)); @@ -1630,7 +1604,6 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_transformer.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::remove_reference, std::common_type, std::index_sequence, std::make_index_sequence, std::forward, std::move, std::integral_constant, std::declval #include // std::tuple_size, std::get @@ -1643,7 +1616,6 @@ namespace sqlite_orm::internal { // #include "../functional/mpl.h" - namespace sqlite_orm::internal { template class Op> struct tuple_transformer; @@ -1779,7 +1751,6 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_iteration.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::get, std::tuple_element, std::tuple_size #include // std::index_sequence, std::make_index_sequence @@ -1847,7 +1818,6 @@ namespace sqlite_orm::internal { // #include "type_traits.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::is_empty, std::is_aggregate #if __cpp_lib_unwrap_ref >= 201811L @@ -1859,7 +1829,6 @@ namespace sqlite_orm::internal { // #include "functional/cxx_type_traits_polyfill.h" - // C++ generic traits used throughout the library namespace sqlite_orm::internal { template @@ -1997,7 +1966,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "alias.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same #include // std::make_index_sequence, std::move @@ -2014,7 +1982,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "functional/cstring_literal.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include // std::index_sequence @@ -2052,7 +2019,6 @@ namespace sqlite_orm::internal { // #include "alias_traits.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_base_of, std::is_same, std::remove_const #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -2064,7 +2030,6 @@ namespace sqlite_orm::internal { // #include "type_traits.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @short Base class for a custom table alias, column alias or expression alias. @@ -2223,7 +2188,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_of.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible, std::bool_constant #endif @@ -2232,7 +2196,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "member_traits/member_traits.h" - namespace sqlite_orm::internal { template struct column_pointer; @@ -2283,7 +2246,6 @@ namespace sqlite_orm::internal { // #include "table_type_of.h" - namespace sqlite_orm::internal { template struct column_pointer; @@ -2324,10 +2286,8 @@ namespace sqlite_orm::internal { // #include "tags.h" - // #include "functional/cxx_functional_polyfill.h" - namespace sqlite_orm::internal { struct negatable_t {}; @@ -2353,7 +2313,6 @@ namespace sqlite_orm::internal { // #include "column_pointer.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible, std::is_base_of #include // std::move @@ -2365,7 +2324,6 @@ namespace sqlite_orm::internal { // #include "table_reference.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::remove_const, std::type_identity #include // std::move @@ -2378,10 +2336,8 @@ namespace sqlite_orm::internal { // #include "literal.h" - // #include "functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { /* @@ -2401,7 +2357,6 @@ namespace sqlite_orm::internal { using is_literal = polyfill::bool_constant>; } - namespace sqlite_orm::internal { /* * Bound input arguments for eponymous virtual tables used in table-valued function calls. @@ -2441,7 +2396,7 @@ namespace sqlite_orm::internal { template constexpr SQLITE_ORM_STATIC_CALLOP table_valued_expression operator()(Args... arguments) SQLITE_ORM_OR_CONST_CALLOP { - return {{{std::move(arguments)}...}}; + return {{ {std::move(arguments)}... }}; } #endif }; @@ -2477,7 +2432,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "tags.h" - namespace sqlite_orm::internal { /** * This class is used to store explicit mapped type T and its column descriptor (member pointer/getter/setter). @@ -3102,7 +3056,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "error_code.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::error_code, std::system_error @@ -3273,7 +3226,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "type_printer.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::shared_ptr, std::unique_ptr @@ -3281,7 +3233,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { #endif // #include "functional/cxx_optional.h" - // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/gsl.h" @@ -3290,7 +3241,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "is_std_ptr.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include @@ -3323,7 +3273,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { }; } - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -3398,7 +3347,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "constraints.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_base_of, std::false_type, std::true_type #include // std::system_error @@ -3413,7 +3361,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "tuple_helper/same_or_void.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::common_type #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -3476,7 +3423,6 @@ namespace sqlite_orm::internal { // #include "collate_argument.h" - namespace sqlite_orm::internal { enum class collate_argument { binary, @@ -3493,7 +3439,6 @@ namespace sqlite_orm::internal { // #include "type_printer.h" - namespace sqlite_orm::internal { enum class conflict_clause_t { rollback, @@ -4236,7 +4181,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_printer.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::stringstream @@ -4256,7 +4200,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "type_traits.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -4413,7 +4356,6 @@ namespace sqlite_orm { // #include "rowid.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -4483,7 +4425,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "operators.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move @@ -4495,13 +4436,10 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "serialize_result_type.h" - // #include "functional/cxx_string_view.h" - // #include "cxx_core_features.h" - #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #elif __has_include() @@ -4520,7 +4458,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "functional/gsl.h" - namespace sqlite_orm::internal { #ifdef SQLITE_ORM_STRING_VIEW_SUPPORTED using serialize_result_type = std::string_view; @@ -4533,7 +4470,6 @@ namespace sqlite_orm::internal { #endif } - namespace sqlite_orm::internal { template struct binary_operator : Ds... { @@ -4823,7 +4759,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "select_constraints.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include @@ -4835,12 +4770,10 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { #endif // #include "functional/cxx_optional.h" - // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/is_base_template_of.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::declval #endif @@ -4884,7 +4817,6 @@ namespace sqlite_orm::internal { // #include "optional_container.h" - namespace sqlite_orm::internal { /** * This is a cute class which allows storing something or nothing @@ -4915,7 +4847,6 @@ namespace sqlite_orm::internal { // #include "ast/where.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move @@ -4925,7 +4856,6 @@ namespace sqlite_orm::internal { // #include "../serialize_result_type.h" - namespace sqlite_orm::internal { struct where_string { serialize_result_type serialize() const { @@ -4972,7 +4902,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/group_by.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple, std::make_tuple #include // std::true_type, std::false_type @@ -4981,7 +4910,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { template struct group_by_with_having { @@ -5025,7 +4953,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/limit.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #include // std::true_type, std::false_type @@ -5037,10 +4964,8 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "offset.h" - // #include "../functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { /** * Stores OFFSET only info @@ -5067,7 +4992,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } - namespace sqlite_orm::internal { /** * Stores LIMIT/OFFSET info @@ -5124,7 +5048,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "core_functions.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::make_tuple, std::tuple_size @@ -5143,7 +5066,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "conditions.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::enable_if, std::is_same, std::remove_const @@ -5168,7 +5090,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "serializer_context.h" - namespace sqlite_orm::internal { struct serializer_context_base { bool replace_bindable_with_question = false; @@ -5197,7 +5118,6 @@ namespace sqlite_orm::internal { // #include "expression.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include // std::enable_if @@ -5205,14 +5125,12 @@ namespace sqlite_orm::internal { #endif // #include "functional/cxx_optional.h" - // #include "functional/cxx_type_traits_polyfill.h" // #include "tags.h" // #include "operators.h" - namespace sqlite_orm::internal { template struct in_t; @@ -5314,7 +5232,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/cross_join.h" // #include "../functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { /** * CROSS JOIN holder. @@ -5337,7 +5254,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } - namespace sqlite_orm::internal { /** * Collated something @@ -6400,7 +6316,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_traits.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -6414,7 +6329,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_of.h" - namespace sqlite_orm::internal { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED template @@ -6444,12 +6358,10 @@ namespace sqlite_orm::internal { // #include "ast/into.h" - // #include "../functional/cxx_type_traits_polyfill.h" // #include "../table_reference.h" - namespace sqlite_orm::internal { template struct into_t { @@ -6476,7 +6388,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/window.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::tuple @@ -6486,7 +6397,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { struct unbounded_preceding_t {}; @@ -6686,7 +6596,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "field_of.h" - namespace sqlite_orm::internal { template struct unique_ptr_result_of {}; @@ -8908,7 +8817,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "cte_moniker.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #ifdef SQLITE_ORM_WITH_CPP20_ALIASES @@ -8925,7 +8833,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "alias.h" - #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) namespace sqlite_orm::internal { /** @@ -9001,7 +8908,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "schema/column.h" - #include // sqlite_int64 #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple @@ -9023,17 +8929,14 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../type_is_nullable.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::false_type, std::true_type, std::enable_if #include // std::shared_ptr, std::unique_ptr #endif // #include "functional/cxx_optional.h" - // #include "functional/cxx_type_traits_polyfill.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -9069,7 +8972,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../constraints.h" - namespace sqlite_orm::internal { struct column_identifier { @@ -9335,7 +9237,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } - namespace sqlite_orm::internal { #ifdef SQLITE_ORM_OPTIONAL_SUPPORTED template @@ -10143,7 +10044,6 @@ namespace sqlite_orm::internal { // #include "statement_binder.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_arithmetic, std::is_same, std::make_index_sequence, std::index_sequence @@ -10165,7 +10065,7 @@ namespace sqlite_orm::internal { // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/cxx_functional_polyfill.h" - // std::invoke +// std::invoke // #include "is_std_ptr.h" // #include "tuple_helper/tuple_filter.h" @@ -10176,14 +10076,12 @@ namespace sqlite_orm::internal { // #include "arithmetic_tag.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_integral #endif // #include "functional/mpl/conditional.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -10204,7 +10102,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "xdestroy_handling.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::integral_constant #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -10216,7 +10113,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "functional/gsl.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { using xdestroy_fn_t = void (*)(void*); @@ -10455,7 +10351,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "pointer_value.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3020000 #include @@ -10473,7 +10368,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "xdestroy_handling.h" - #if SQLITE_VERSION_NUMBER >= 3020000 namespace sqlite_orm::internal { #ifdef SQLITE_ORM_WITH_CPP20_ALIASES @@ -10761,7 +10655,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } #endif - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -11111,7 +11004,6 @@ namespace sqlite_orm::internal { // #include "column_result.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic, std::is_base_of #include // std::reference_wrapper @@ -11127,7 +11019,6 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_fy.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #endif @@ -11158,7 +11049,6 @@ namespace sqlite_orm::internal { // #include "mapped_type_proxy.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::remove_const #endif @@ -11171,7 +11061,6 @@ namespace sqlite_orm::internal { // #include "alias_traits.h" - namespace sqlite_orm::internal { /** * Defines the `type` typename to be: @@ -11208,7 +11097,6 @@ namespace sqlite_orm::internal { // #include "column_result_proxy.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #endif @@ -11221,7 +11109,6 @@ namespace sqlite_orm::internal { // #include "table_reference.h" - namespace sqlite_orm::internal { /* * Holder for the type of an unmapped aggregate/structure/object to be constructed ad-hoc from column results. @@ -11263,7 +11150,6 @@ namespace sqlite_orm::internal { // #include "cte_types.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include @@ -11272,7 +11158,6 @@ namespace sqlite_orm::internal { // #include "tuple_helper/tuple_fy.h" - #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) namespace sqlite_orm::internal { /** @@ -11322,7 +11207,6 @@ namespace sqlite_orm::internal { // #include "storage_traits.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple #endif @@ -11337,7 +11221,6 @@ namespace sqlite_orm::internal { // #include "storage_lookup.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::remove_const, std::enable_if, std::is_base_of, std::is_void #include // std::tuple_size, std::get @@ -11348,7 +11231,6 @@ namespace sqlite_orm::internal { // #include "type_traits.h" - namespace sqlite_orm::internal { template struct storage_t; @@ -11487,7 +11369,6 @@ namespace sqlite_orm::internal { // #include "schema/column.h" - namespace sqlite_orm::internal::storage_traits { /** * DBO - db object (table) @@ -11531,7 +11412,6 @@ namespace sqlite_orm::internal::storage_traits { // #include "function.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_member_function_pointer, std::is_function, std::remove_const, std::decay, std::is_convertible, std::is_same, std::false_type, std::true_type, std::is_pointer #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED @@ -11549,12 +11429,10 @@ namespace sqlite_orm::internal::storage_traits { // #include "functional/function_traits.h" - // #include "cxx_type_traits_polyfill.h" // #include "mpl.h" - namespace sqlite_orm::internal { /* * Define nested typenames: @@ -11633,7 +11511,6 @@ namespace sqlite_orm::internal { // #include "tags.h" - // export forward-declarations SQLITE_ORM_EXPORT namespace sqlite_orm { struct arg_values; @@ -12199,7 +12076,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/special_keywords.h" - namespace sqlite_orm::internal { struct current_time_t {}; struct current_date_t {}; @@ -12221,7 +12097,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/cast.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // SQLITE_ORM_IMPORT_STD_MODULE @@ -12255,7 +12130,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/in.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::initializer_list #include // std::tuple @@ -12265,7 +12139,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../tags.h" - namespace sqlite_orm::internal { struct in_base { @@ -12372,13 +12245,11 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/between.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // #include "tags.h" - namespace sqlite_orm::internal { /** * BETWEEN operator object. @@ -12410,7 +12281,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/is_null.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif @@ -12419,7 +12289,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/config.h" - namespace sqlite_orm::internal { /** * IS NULL operator object. @@ -12447,7 +12316,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } // #include "ast/is_not_null.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif @@ -12456,7 +12324,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/config.h" - namespace sqlite_orm::internal { /** * IS NOT NULL operator object. @@ -12487,14 +12354,12 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/rank.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::forward #endif // #include "window.h" - namespace sqlite_orm::internal { struct rank_t { template @@ -12516,7 +12381,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "window_functions.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple #include // std::forward, std::move @@ -12524,7 +12388,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/window.h" - namespace sqlite_orm::internal { struct row_number_t { @@ -12747,7 +12610,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } - namespace sqlite_orm::internal { /** * Obtains the result type of expressions that form the columns of a select statement. @@ -13146,7 +13008,6 @@ namespace sqlite_orm::internal { // #include "sync_schema_result.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #endif @@ -13220,7 +13081,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "table_info.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::move @@ -13273,7 +13133,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_impl.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -13296,7 +13155,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "schema/table.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::remove_const, std::true_type, std::false_type @@ -13321,7 +13179,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "table_base.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_member_pointer, std::remove_cvref #include // std::string @@ -13348,7 +13205,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "column.h" - namespace sqlite_orm::internal { struct table_identifier { @@ -13611,7 +13467,6 @@ namespace sqlite_orm::internal { // #include "index.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple, std::make_tuple, std::declval, std::tuple_element_t #include // std::string @@ -13622,7 +13477,6 @@ namespace sqlite_orm::internal { // #include "../indexed_column.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #include // std::move @@ -13630,7 +13484,6 @@ namespace sqlite_orm::internal { // #include "ast/where.h" - namespace sqlite_orm::internal { template struct indexed_column_t { @@ -13688,7 +13541,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_type_of.h" - namespace sqlite_orm::internal { struct index_base { std::string name; @@ -13736,7 +13588,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } - namespace sqlite_orm::internal { template using is_base_table_element_or_constraint = mpl::invoke_t, @@ -13889,7 +13740,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" - // interface functions namespace sqlite_orm::internal { template @@ -13996,7 +13846,6 @@ namespace sqlite_orm::internal { // #include "journal_mode.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::array #include // std::string @@ -14007,7 +13856,6 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" - #if defined(_WINNT_) // DELETE is a macro defined in the Windows SDK (winnt.h) #pragma push_macro("DELETE") @@ -14087,7 +13935,6 @@ namespace sqlite_orm::internal { // #include "mapped_view.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include // std::forward, std::move @@ -14095,7 +13942,6 @@ namespace sqlite_orm::internal { // #include "row_extractor.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if_t, std::is_arithmetic, std::is_same, std::enable_if @@ -14130,7 +13976,6 @@ namespace sqlite_orm::internal { // #include "locking_mode.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::array #include // std::string @@ -14141,7 +13986,6 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { enum class locking_mode : signed char { NORMAL = 0, @@ -14195,7 +14039,6 @@ namespace sqlite_orm::internal { // #include "type_traits.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -14726,7 +14569,6 @@ namespace sqlite_orm::internal { // #include "mapped_iterator.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::shared_ptr, std::make_shared @@ -14738,7 +14580,6 @@ namespace sqlite_orm::internal { // #include "statement_finalizer.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::unique_ptr @@ -14772,7 +14613,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "object_from_column_builder.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_member_object_pointer @@ -14791,7 +14631,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" - namespace sqlite_orm::internal { struct object_from_column_builder_base { sqlite3_stmt* stmt = nullptr; @@ -14856,7 +14695,6 @@ namespace sqlite_orm::internal { // #include "util.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string @@ -14870,7 +14708,6 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @@ -15067,7 +14904,6 @@ namespace sqlite_orm::internal { }; } - namespace sqlite_orm::internal { /* * (Legacy) Input iterator over a result set for a mapped object. @@ -15166,7 +15002,6 @@ namespace sqlite_orm::internal { // #include "ast_iterator.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_invocable #include // std::vector @@ -15174,7 +15009,7 @@ namespace sqlite_orm::internal { #endif // #include "functional/cxx_functional_polyfill.h" - // std::is_invocable +// std::is_invocable // #include "tuple_helper/tuple_iteration.h" // #include "type_traits.h" @@ -15191,7 +15026,6 @@ namespace sqlite_orm::internal { // #include "prepared_statement.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::unique_ptr @@ -15213,7 +15047,6 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::atomic_int, memory order flags @@ -15226,7 +15059,6 @@ namespace sqlite_orm::internal { // #include "functional/cxx_new.h" - #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include #else @@ -15249,7 +15081,6 @@ namespace sqlite_orm { // #include "functional/cxx_scope_guard.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::forward #endif @@ -15278,10 +15109,8 @@ namespace sqlite_orm::internal { // #include "vfs_name.h" - // #include "serialize_result_type.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { #ifdef SQLITE_ORM_UNIX @@ -15304,7 +15133,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "db_open_mode.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { enum class db_open_mode { @@ -15329,7 +15157,6 @@ namespace sqlite_orm::internal { // #include "storage_options.h" - #include #ifdef SQLITE_ORM_IMPORT_STD_MODULE #include @@ -15341,7 +15168,6 @@ namespace sqlite_orm::internal { // #include "serialize_result_type.h" - namespace sqlite_orm::internal { template using storage_opt_tag_t = typename T::storage_opt_tag; @@ -15399,7 +15225,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } - namespace sqlite_orm::internal { struct db_arguments { db_arguments(std::string filename, const connection_control& connectionCtrl = {}) : @@ -15686,7 +15511,6 @@ namespace sqlite_orm::internal { // #include "values.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::vector #include // std::tuple @@ -15695,7 +15519,6 @@ namespace sqlite_orm::internal { // #include "functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { template struct values_t { @@ -15734,7 +15557,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/upsert_clause.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3024000 #include // std::tuple @@ -15744,7 +15566,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../functional/cxx_type_traits_polyfill.h" - namespace sqlite_orm::internal { #if SQLITE_VERSION_NUMBER >= 3024000 template @@ -15812,7 +15633,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/set.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::tuple, std::tuple_size #include // std::string @@ -15825,7 +15645,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_name_collector.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::set #include // std::string @@ -15846,7 +15665,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" - namespace sqlite_orm::internal { struct table_name_collector_base { using table_name_set = std::set>; @@ -15924,7 +15742,6 @@ namespace sqlite_orm::internal { }; } - namespace sqlite_orm::internal { template void iterate_ast(const T& t, L&& lambda); @@ -16022,7 +15839,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { } } - namespace sqlite_orm::internal { struct prepared_statement_base { orm_gsl::owner stmt = nullptr; @@ -16898,7 +16714,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/excluded.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif @@ -16929,14 +16744,12 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/exists.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // #include "../tags.h" - namespace sqlite_orm::internal { template struct exists_t : condition_t, negatable_t { @@ -16968,14 +16781,12 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "ast/match.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move #endif // #include "../type_traits.h" - namespace sqlite_orm::internal { template struct match_with_table_t { @@ -17036,7 +16847,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "window_functions.h" - namespace sqlite_orm::internal { /** * ast_iterator accepts any expression and a callable object @@ -17903,7 +17713,6 @@ namespace sqlite_orm::internal { // #include "util.h" - namespace sqlite_orm::internal { /** * A C++ view over a result set of objects mapped as tables, returned by `storage_t::iterate<>()`. @@ -17953,7 +17762,6 @@ inline constexpr bool std::ranges::enable_borrowed_range #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move, std::remove_cvref @@ -17969,7 +17777,6 @@ inline constexpr bool std::ranges::enable_borrowed_range #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::move @@ -17985,7 +17792,6 @@ inline constexpr bool std::ranges::enable_borrowed_range @@ -18076,7 +17882,6 @@ namespace sqlite_orm::internal { // #include "storage_lookup.h" - namespace sqlite_orm::internal { /* * A C++ view over a result set of a select statement, returned by `storage_t::iterate()`. @@ -18145,7 +17950,6 @@ inline constexpr bool std::ranges::enable_borrowed_range #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // atoi @@ -18165,7 +17969,6 @@ inline constexpr bool std::ranges::enable_borrowed_range #else @@ -18176,7 +17979,7 @@ inline constexpr bool std::ranges::enable_borrowed_range= 201603L @@ -18198,12 +18001,11 @@ namespace sqlite_orm::internal::polyfill { namespace sqlite_orm { namespace polyfill = internal::polyfill; } - // std::apply +// std::apply // #include "tuple_helper/tuple_iteration.h" // #include "pragma.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string @@ -18230,7 +18032,6 @@ namespace sqlite_orm { // #include "serializing_util.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::index_sequence, std::remove_cvref #include @@ -18241,7 +18042,7 @@ namespace sqlite_orm { #endif // #include "functional/cxx_type_traits_polyfill.h" - // std::remove_cvref, polyfill::is_detected +// std::remove_cvref, polyfill::is_detected // #include "functional/cxx_functional_polyfill.h" // #include "functional/gsl.h" @@ -18260,7 +18061,6 @@ namespace sqlite_orm { // #include "schema/column.h" - namespace sqlite_orm::internal { template struct order_by_t; @@ -18704,7 +18504,6 @@ namespace sqlite_orm::internal { } } - namespace sqlite_orm::internal { struct storage_base; struct sqlite_executor; @@ -18968,7 +18767,6 @@ namespace sqlite_orm::internal { // #include "limit_accessor.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::map @@ -18978,7 +18776,6 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" - namespace sqlite_orm::internal { struct limit_accessor { limit_accessor(std::unique_ptr& connection) : connection{connection} {} @@ -19107,7 +18904,6 @@ namespace sqlite_orm::internal { // #include "transaction_guard.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::function #include // std::move @@ -19115,7 +18911,6 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" - namespace sqlite_orm::internal { /** * Class used as a guard for a transaction. Calls `ROLLBACK` in destructor. @@ -19192,7 +18987,6 @@ namespace sqlite_orm::internal { // #include "backup.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::system_error @@ -19205,7 +18999,6 @@ namespace sqlite_orm::internal { // #include "connection_holder.h" - namespace sqlite_orm::internal { /** * A backup class. Don't construct it as is, call storage.make_backup_from or storage.make_backup_to instead. @@ -19269,7 +19062,6 @@ namespace sqlite_orm::internal { // #include "values_to_tuple.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::index_sequence, std::make_index_sequence @@ -19280,14 +19072,12 @@ namespace sqlite_orm::internal { // #include "arg_values.h" - #include // #include "error_code.h" // #include "row_extractor.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** @short Wrapper around a dynamically typed value object. @@ -19433,7 +19223,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { }; } - namespace sqlite_orm::internal { template @@ -19473,7 +19262,6 @@ namespace sqlite_orm::internal { // #include "udf_proxy.h" - #include #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // assert macro @@ -19487,7 +19275,6 @@ namespace sqlite_orm::internal { // #include "error_code.h" - namespace sqlite_orm::internal { /* * Returns properly allocated memory space for the specified application-defined function object @@ -19706,7 +19493,6 @@ namespace sqlite_orm::internal { // #include "storage_options.h" - namespace sqlite_orm::internal { struct storage_base { public: @@ -20831,7 +20617,6 @@ namespace sqlite_orm::internal { // #include "expression_object_type.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::decay, std::remove_reference #include // std::reference_wrapper @@ -20841,7 +20626,6 @@ namespace sqlite_orm::internal { // #include "prepared_statement.h" - namespace sqlite_orm::internal { template struct expression_object_type; @@ -20948,7 +20732,6 @@ namespace sqlite_orm::internal { // #include "statement_serializer.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::remove_pointer, std::remove_reference, std::remove_cvref, std::disjunction #include // std::stringstream @@ -20969,16 +20752,14 @@ namespace sqlite_orm::internal { // #include "functional/cxx_optional.h" - // #include "functional/cxx_type_traits_polyfill.h" - // std::remove_cvref, std::disjunction +// std::remove_cvref, std::disjunction // #include "functional/cxx_functional_polyfill.h" - // std::identity, std::invoke +// std::identity, std::invoke // #include "functional/gsl.h" // #include "functional/always_default.h" - namespace sqlite_orm::internal { /* * Function object whose variadic call operator always returns the default constructed value of its template parameter type. @@ -21051,7 +20832,6 @@ namespace sqlite_orm::internal { // #include "column_names_getter.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_base_of #include // std::string @@ -21074,12 +20854,11 @@ namespace sqlite_orm::internal { // #include "select_constraints.h" // #include "storage_lookup.h" - // pick_table +// pick_table // #include "serializer_context.h" // #include "util.h" - namespace sqlite_orm::internal { template auto serialize(const T& t, const Ctx& context); @@ -21187,7 +20966,6 @@ namespace sqlite_orm::internal { // #include "cte_column_names_collector.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include // std::to_string @@ -21209,7 +20987,6 @@ namespace sqlite_orm::internal { // #include "select_constraints.h" - #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) namespace sqlite_orm::internal { // collecting column names utilizes the statement serializer @@ -21419,7 +21196,6 @@ namespace sqlite_orm::internal { // #include "order_by_serializer.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include // std::string @@ -21429,7 +21205,6 @@ namespace sqlite_orm::internal { // #include "functional/gsl.h" - namespace sqlite_orm::internal { template struct order_by_serializer; @@ -21514,7 +21289,6 @@ namespace sqlite_orm::internal { // #include "schema/triggers.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include #include @@ -21524,7 +21298,6 @@ namespace sqlite_orm::internal { // #include "../optional_container.h" - // NOTE Idea : Maybe also implement a custom trigger system to call a c++ callback when a trigger triggers ? // (Could be implemented with a normal trigger that insert or update an internal table and then retreive // the event in the C++ code, to call the C++ user callback, with update hooks: https://www.sqlite.org/c3ref/update_hook.html) @@ -21803,7 +21576,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "schema/virtual_table.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include // std::convertible_to @@ -21827,7 +21599,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "column.h" - namespace sqlite_orm::internal { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED template @@ -21962,7 +21733,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { #endif } - namespace sqlite_orm::internal { template struct statement_serializer; @@ -24779,7 +24549,6 @@ namespace sqlite_orm::internal { // #include "cte_storage.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include // std::remove_const @@ -24807,7 +24576,6 @@ namespace sqlite_orm::internal { // #include "column_expression.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic #include // std::tuple @@ -24826,7 +24594,6 @@ namespace sqlite_orm::internal { // #include "storage_traits.h" - namespace sqlite_orm::internal { template struct column_expression_type; @@ -24921,7 +24688,6 @@ namespace sqlite_orm::internal { // #include "storage_lookup.h" - namespace sqlite_orm::internal { #if (SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) // F = field_type @@ -25250,10 +25016,8 @@ namespace sqlite_orm::internal { // #include "udf_existence_checker.h" - // #include "functional/cxx_string_view.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::ranges::find #endif @@ -25268,7 +25032,6 @@ namespace sqlite_orm::internal { // #include "storage_base.h" - namespace sqlite_orm::internal { #ifdef SQLITE_ORM_STRING_VIEW_SUPPORTED /* @@ -25321,7 +25084,6 @@ namespace sqlite_orm::internal { #endif } - namespace sqlite_orm::internal { /* * Implementation note: the technique of indirect expression testing is because @@ -27128,7 +26890,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { * this file is also used to provide definitions of interface methods 'hitting the database'. */ - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::make_unique #endif @@ -27137,7 +26898,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../default_value_extractor.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -27148,7 +26908,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "storage_lookup.h" - namespace sqlite_orm::internal { template auto serialize(const T& t, const Ctx& context); @@ -27166,7 +26925,6 @@ namespace sqlite_orm::internal { // #include "../schema/column.h" - namespace sqlite_orm::internal { template std::unique_ptr column_constraints::default_value() const { @@ -27187,7 +26945,6 @@ namespace sqlite_orm::internal { * this file is also used to provide definitions of interface methods 'hitting the database'. */ - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::remove_reference #include // std::move @@ -27204,7 +26961,6 @@ namespace sqlite_orm::internal { // #include "../schema/table.h" - namespace sqlite_orm::internal { template std::vector base_table::get_table_info() const { @@ -27259,7 +27015,6 @@ namespace sqlite_orm::internal { * this file is also used to separate implementation details from the main header file. */ - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::is_same #include // std::stringstream @@ -27272,7 +27027,6 @@ namespace sqlite_orm::internal { // #include "../sqlite_schema_table.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::string #endif @@ -27285,7 +27039,6 @@ namespace sqlite_orm::internal { // #include "alias.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { /** * SQLite's "schema table" that stores the schema for a database. @@ -27335,7 +27088,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../storage.h" - namespace sqlite_orm::internal { template template> @@ -27493,7 +27245,6 @@ namespace sqlite_orm::internal { // #include "node_tuple.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #include // std::enable_if #include // std::tuple @@ -27549,7 +27300,6 @@ namespace sqlite_orm::internal { // #include "window_functions.h" - namespace sqlite_orm::internal { template struct node_tuple { @@ -27871,7 +27621,6 @@ namespace sqlite_orm::internal { // #include "expression_object_type.h" - SQLITE_ORM_EXPORT namespace sqlite_orm { template @@ -28033,7 +27782,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "dbstat.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ENABLE_DBSTAT_VTAB #include // std::false_type, std::true_type, std::is_convertible @@ -28057,7 +27805,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_reference.h" - #ifdef SQLITE_ENABLE_DBSTAT_VTAB namespace sqlite_orm::internal { struct dbstat_module_tag { @@ -28180,7 +27927,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "generate_series.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3008012 #include // std::tuple_element, std::make_tuple @@ -28196,7 +27942,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../table_reference.h" - #if SQLITE_VERSION_NUMBER >= 3008012 namespace sqlite_orm::internal { struct generate_series_module_tag { @@ -28282,7 +28027,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "fts5.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3009000 || defined(SQLITE_ORM_ENABLE_FTS5) #include // std::tuple_size, std::make_tuple, std::get @@ -28305,7 +28049,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../constraints.h" - #if SQLITE_VERSION_NUMBER >= 3009000 || defined(SQLITE_ORM_ENABLE_FTS5) namespace sqlite_orm::internal { template @@ -28434,7 +28177,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "rtree.h" - #ifndef SQLITE_ORM_IMPORT_STD_MODULE #ifdef SQLITE_ENABLE_RTREE #include // std::is_same @@ -28456,7 +28198,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "../schema/column.h" - #ifdef SQLITE_ENABLE_RTREE namespace sqlite_orm::internal { template @@ -28540,7 +28281,6 @@ SQLITE_ORM_EXPORT namespace sqlite_orm { // #include "pointer_value.h" - #if SQLITE_VERSION_NUMBER >= 3020000 SQLITE_ORM_EXPORT namespace sqlite_orm { From da15a56514120e527d2d521a571daa79f176b744 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Wed, 29 Apr 2026 00:15:05 +0500 Subject: [PATCH 13/13] Enhance C++20 views support by refining preprocessor directives - Updated `config.h` and `cxx_compiler_quirks.h` to conditionally define `SQLITE_ORM_CPP20_VIEWS_SUPPORTED` based on the presence of `SQLITE_ORM_BROKEN_CPP20_VIEWS` for better compatibility with Clang versions. - Ensured that the definition of `SQLITE_ORM_CPP20_VIEWS_SUPPORTED` is only active when the necessary conditions are met, improving overall code robustness. --- dev/functional/config.h | 2 +- dev/functional/cxx_compiler_quirks.h | 4 ++-- include/sqlite_orm/sqlite_orm.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/functional/config.h b/dev/functional/config.h index 022a3166..e2a3d497 100644 --- a/dev/functional/config.h +++ b/dev/functional/config.h @@ -55,7 +55,7 @@ #define SQLITE_ORM_CPP20_RANGES_SUPPORTED #endif -#if __cpp_lib_ranges >= 202110L +#if __cpp_lib_ranges >= 202110L && !defined(SQLITE_ORM_BROKEN_CPP20_VIEWS) #define SQLITE_ORM_CPP20_VIEWS_SUPPORTED #endif diff --git a/dev/functional/cxx_compiler_quirks.h b/dev/functional/cxx_compiler_quirks.h index b99b7135..68a13d72 100644 --- a/dev/functional/cxx_compiler_quirks.h +++ b/dev/functional/cxx_compiler_quirks.h @@ -73,6 +73,6 @@ #define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS #endif -#if defined(SQLITE_ORM_CPP20_VIEWS_SUPPORTED) && (defined(__clang__) && (__clang_major__ <= 15)) -#undef SQLITE_ORM_CPP20_VIEWS_SUPPORTED +#if defined(__clang__) && (__clang_major__ <= 15) +#define SQLITE_ORM_BROKEN_CPP20_VIEWS #endif diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index 6d00cd3f..b75dfc5e 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -221,8 +221,8 @@ using std::nullptr_t; #define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS #endif -#if defined(SQLITE_ORM_CPP20_VIEWS_SUPPORTED) && (defined(__clang__) && (__clang_major__ <= 15)) -#undef SQLITE_ORM_CPP20_VIEWS_SUPPORTED +#if defined(__clang__) && (__clang_major__ <= 15) +#define SQLITE_ORM_BROKEN_CPP20_VIEWS #endif // #include "platform_definitions.h" @@ -317,7 +317,7 @@ using std::nullptr_t; #define SQLITE_ORM_CPP20_RANGES_SUPPORTED #endif -#if __cpp_lib_ranges >= 202110L +#if __cpp_lib_ranges >= 202110L && !defined(SQLITE_ORM_BROKEN_CPP20_VIEWS) #define SQLITE_ORM_CPP20_VIEWS_SUPPORTED #endif