From b0c02a197ccf08136642f8c1bbdb60dfd41903fd Mon Sep 17 00:00:00 2001 From: klaus triendl Date: Wed, 17 Jul 2024 21:31:22 +0200 Subject: [PATCH] Import named module `std` when building named module `sqlite_orm` --- dev/alias.h | 2 + dev/alias_traits.h | 2 + dev/arithmetic_tag.h | 2 + dev/ast/excluded.h | 2 + dev/ast/exists.h | 2 + dev/ast/group_by.h | 2 + dev/ast/match.h | 3 + dev/ast/set.h | 2 + dev/ast/upsert_clause.h | 2 + dev/ast/where.h | 2 + dev/ast_iterator.h | 2 + dev/backup.h | 2 + dev/carray.h | 2 + dev/column_expression.h | 2 + dev/column_names_getter.h | 2 + dev/column_pointer.h | 2 + dev/column_result.h | 8 +- dev/conditions.h | 2 + dev/connection_holder.h | 2 + dev/constraints.h | 2 + dev/core_functions.h | 2 + dev/cte_column_names_collector.h | 2 + dev/cte_moniker.h | 2 + dev/cte_storage.h | 2 + dev/cte_types.h | 2 + dev/default_value_extractor.h | 2 + dev/eponymous_vtabs/dbstat.h | 2 + dev/error_code.h | 2 + dev/expression.h | 6 +- dev/expression_object_type.h | 2 + dev/field_printer.h | 10 +- dev/function.h | 8 +- dev/functional/cstring_literal.h | 2 + dev/functional/cxx_functional_polyfill.h | 4 + dev/functional/cxx_optional.h | 4 + dev/functional/cxx_string_view.h | 4 + dev/functional/cxx_tuple_polyfill.h | 4 + dev/functional/cxx_type_traits_polyfill.h | 5 + dev/functional/cxx_universal.h | 2 + dev/functional/index_sequence_util.h | 2 + dev/functional/mpl.h | 2 + dev/functional/static_magic.h | 2 + dev/get_prepared_statement.h | 2 + dev/implementations/column_definitions.h | 2 + dev/implementations/storage_definitions.h | 2 + dev/implementations/table_definitions.h | 2 + dev/indexed_column.h | 2 + dev/is_base_of_template.h | 2 + dev/is_std_ptr.h | 2 + dev/journal_mode.h | 2 + dev/limit_accessor.h | 2 + dev/mapped_iterator.h | 2 + dev/mapped_type_proxy.h | 2 + dev/mapped_view.h | 2 + dev/member_traits/member_traits.h | 2 + dev/node_tuple.h | 2 + dev/object_from_column_builder.h | 2 + dev/operators.h | 2 + dev/order_by_serializer.h | 2 + dev/pointer_value.h | 2 + dev/pragma.h | 2 + dev/prepared_statement.h | 2 + dev/result_set_iterator.h | 2 + dev/result_set_view.h | 2 + dev/row_extractor.h | 12 +- dev/rowid.h | 2 + dev/schema/column.h | 2 + dev/schema/index.h | 2 + dev/schema/table.h | 2 + dev/schema/triggers.h | 2 + dev/select_constraints.h | 2 + dev/serialize_result_type.h | 2 + dev/serializing_util.h | 2 + dev/sqlite_schema_table.h | 2 + dev/statement_binder.h | 12 +- dev/statement_finalizer.h | 2 + dev/statement_serializer.h | 6 +- dev/storage.h | 2 + dev/storage_base.h | 2 + dev/storage_impl.h | 2 + dev/storage_lookup.h | 2 + dev/storage_traits.h | 2 + dev/sync_schema_result.h | 2 + dev/table_info.h | 2 + dev/table_name_collector.h | 2 + dev/table_reference.h | 2 + dev/table_type_of.h | 2 + dev/transaction_guard.h | 2 + dev/tuple_helper/same_or_void.h | 2 + dev/tuple_helper/tuple_filter.h | 2 + dev/tuple_helper/tuple_fy.h | 2 + dev/tuple_helper/tuple_iteration.h | 2 + dev/tuple_helper/tuple_transformer.h | 2 + dev/type_is_nullable.h | 2 + dev/type_printer.h | 2 + dev/type_traits.h | 2 + dev/udf_proxy.h | 2 + dev/util.h | 2 + dev/values.h | 2 + dev/values_to_tuple.h | 2 + dev/xdestroy_handling.h | 4 +- examples/iteration.cpp | 4 +- include/sqlite_orm/sqlite_orm.h | 264 ++++++++++++++++++++-- modules/sqlite_orm.ixx | 10 + 104 files changed, 491 insertions(+), 51 deletions(-) diff --git a/dev/alias.h b/dev/alias.h index 784d3dde6..165c63fb5 100644 --- a/dev/alias.h +++ b/dev/alias.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same #include // std::make_index_sequence, std::move #include // std::string @@ -7,6 +8,7 @@ #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #endif +#endif #include "functional/cxx_type_traits_polyfill.h" #include "functional/mpl/conditional.h" diff --git a/dev/alias_traits.h b/dev/alias_traits.h index 95ce37c1c..9585c9cdd 100644 --- a/dev/alias_traits.h +++ b/dev/alias_traits.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::is_base_of, std::is_same #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include #endif +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/arithmetic_tag.h b/dev/arithmetic_tag.h index 5c0d37a2d..c7fd0cec1 100644 --- a/dev/arithmetic_tag.h +++ b/dev/arithmetic_tag.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::is_integral +#endif #include "functional/mpl/conditional.h" diff --git a/dev/ast/excluded.h b/dev/ast/excluded.h index 4bf5874cb..1bbcbbc12 100644 --- a/dev/ast/excluded.h +++ b/dev/ast/excluded.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::move +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { namespace internal { diff --git a/dev/ast/exists.h b/dev/ast/exists.h index 0cbfb0ea3..85bb3142a 100644 --- a/dev/ast/exists.h +++ b/dev/ast/exists.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::move +#endif #include "../tags.h" diff --git a/dev/ast/group_by.h b/dev/ast/group_by.h index 29e9cb43f..b491f7e26 100644 --- a/dev/ast/group_by.h +++ b/dev/ast/group_by.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::tuple, std::make_tuple #include // std::true_type, std::false_type #include // std::forward, std::move +#endif #include "../functional/cxx_type_traits_polyfill.h" diff --git a/dev/ast/match.h b/dev/ast/match.h index f83dd974b..767224258 100644 --- a/dev/ast/match.h +++ b/dev/ast/match.h @@ -1,5 +1,8 @@ #pragma once + +#ifndef _IMPORT_STD_MODULE #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { namespace internal { diff --git a/dev/ast/set.h b/dev/ast/set.h index c562f1093..0f2d8e7cd 100644 --- a/dev/ast/set.h +++ b/dev/ast/set.h @@ -1,10 +1,12 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::tuple, std::tuple_size #include // std::string #include // std::vector #include // std::stringstream #include // std::false_type, std::true_type +#endif #include "../tuple_helper/tuple_traits.h" #include "../table_name_collector.h" diff --git a/dev/ast/upsert_clause.h b/dev/ast/upsert_clause.h index a23e16d31..e15a88b67 100644 --- a/dev/ast/upsert_clause.h +++ b/dev/ast/upsert_clause.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3024000 #include // std::tuple #include // std::forward, std::move #endif +#endif #include "../functional/cxx_type_traits_polyfill.h" diff --git a/dev/ast/where.h b/dev/ast/where.h index 03c518a48..79ca29ee7 100644 --- a/dev/ast/where.h +++ b/dev/ast/where.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move +#endif #include "../functional/cxx_universal.h" #include "../functional/cxx_type_traits_polyfill.h" diff --git a/dev/ast_iterator.h b/dev/ast_iterator.h index 38e3a3f71..3ec9f70c1 100644 --- a/dev/ast_iterator.h +++ b/dev/ast_iterator.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::vector #include // std::reference_wrapper +#endif #include "tuple_helper/tuple_iteration.h" #include "type_traits.h" diff --git a/dev/backup.h b/dev/backup.h index 7b89ec900..8f93b4106 100644 --- a/dev/backup.h +++ b/dev/backup.h @@ -1,10 +1,12 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::system_error #include // std::string #include #include // std::move, std::exchange +#endif #include "error_code.h" #include "connection_holder.h" diff --git a/dev/carray.h b/dev/carray.h index 28144df6b..b0f6a35b0 100644 --- a/dev/carray.h +++ b/dev/carray.h @@ -6,6 +6,7 @@ * Hence we make it only available for compilers supporting inline variables. */ +#ifndef _IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3020000 #ifdef SQLITE_ORM_INLINE_VARIABLES_SUPPORTED #include // std::move @@ -14,6 +15,7 @@ #endif #endif #endif +#endif #include "pointer_value.h" diff --git a/dev/column_expression.h b/dev/column_expression.h index e0d099257..2dea62f10 100644 --- a/dev/column_expression.h +++ b/dev/column_expression.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic #include // std::tuple #include // std::reference_wrapper +#endif #include "functional/cxx_type_traits_polyfill.h" #include "tuple_helper/tuple_transformer.h" diff --git a/dev/column_names_getter.h b/dev/column_names_getter.h index 1792dad73..552bb65bf 100644 --- a/dev/column_names_getter.h +++ b/dev/column_names_getter.h @@ -1,11 +1,13 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::is_base_of #include // std::string #include // std::vector #include // std::reference_wrapper #include #include // std::move +#endif #include "tuple_helper/tuple_traits.h" #include "tuple_helper/tuple_iteration.h" diff --git a/dev/column_pointer.h b/dev/column_pointer.h index 89764b960..211539c79 100644 --- a/dev/column_pointer.h +++ b/dev/column_pointer.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible #include // std::move +#endif #include "functional/cxx_core_features.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/column_result.h b/dev/column_result.h index 6ab442763..0b0ac9dc0 100644 --- a/dev/column_result.h +++ b/dev/column_result.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic, std::is_base_of #include // std::reference_wrapper +#endif -#include "functional/cxx_universal.h" // ::nullptr_t +#include "functional/cxx_universal.h" // std::nullptr_t #include "functional/cxx_type_traits_polyfill.h" #include "functional/mpl.h" #include "tuple_helper/tuple_traits.h" @@ -130,8 +132,8 @@ namespace sqlite_orm { }; template - struct column_result_t { - using type = nullptr_t; + struct column_result_t { + using type = std::nullptr_t; }; template diff --git a/dev/conditions.h b/dev/conditions.h index e4b7b67fd..14353d822 100644 --- a/dev/conditions.h +++ b/dev/conditions.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::enable_if, std::is_same, std::remove_const #include // std::vector @@ -7,6 +8,7 @@ #include // std::move, std::forward #include // std::stringstream #include // std::flush +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/connection_holder.h b/dev/connection_holder.h index 77d277fbc..cd68d4d5b 100644 --- a/dev/connection_holder.h +++ b/dev/connection_holder.h @@ -1,8 +1,10 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include #include // std::string +#endif #include "error_code.h" diff --git a/dev/constraints.h b/dev/constraints.h index ee1971623..9bc8f4277 100644 --- a/dev/constraints.h +++ b/dev/constraints.h @@ -1,10 +1,12 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::is_base_of, std::false_type, std::true_type #include // std::system_error #include // std::ostream #include // std::string #include // std::tuple +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/core_functions.h b/dev/core_functions.h index c051cc362..ec15d6aef 100644 --- a/dev/core_functions.h +++ b/dev/core_functions.h @@ -1,10 +1,12 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::make_tuple, std::tuple_size #include // std::forward, std::is_base_of, std::enable_if #include // std::unique_ptr #include // std::vector +#endif #include "functional/cxx_type_traits_polyfill.h" #include "functional/mpl/conditional.h" diff --git a/dev/cte_column_names_collector.h b/dev/cte_column_names_collector.h index 8cee112e1..104bdfff6 100644 --- a/dev/cte_column_names_collector.h +++ b/dev/cte_column_names_collector.h @@ -1,11 +1,13 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #include #include // std::reference_wrapper #include #endif +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/cte_moniker.h b/dev/cte_moniker.h index f6d6c24f5..3e42ec2b2 100644 --- a/dev/cte_moniker.h +++ b/dev/cte_moniker.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include @@ -9,6 +10,7 @@ #include // std::ignore #include #endif +#endif #include "functional/cxx_universal.h" #include "functional/cstring_literal.h" diff --git a/dev/cte_storage.h b/dev/cte_storage.h index f933d94c9..698f7d26e 100644 --- a/dev/cte_storage.h +++ b/dev/cte_storage.h @@ -1,11 +1,13 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #include #include #include #endif +#endif #include "functional/cxx_universal.h" // ::size_t #include "tuple_helper/tuple_fy.h" diff --git a/dev/cte_types.h b/dev/cte_types.h index 20ee296c3..564207947 100644 --- a/dev/cte_types.h +++ b/dev/cte_types.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #include #endif +#endif #include "functional/cxx_core_features.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/default_value_extractor.h b/dev/default_value_extractor.h index 01002cdc4..291365e7f 100644 --- a/dev/default_value_extractor.h +++ b/dev/default_value_extractor.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif #include "constraints.h" #include "serializer_context.h" diff --git a/dev/eponymous_vtabs/dbstat.h b/dev/eponymous_vtabs/dbstat.h index 4a077faf2..75b82af8b 100644 --- a/dev/eponymous_vtabs/dbstat.h +++ b/dev/eponymous_vtabs/dbstat.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #ifdef SQLITE_ENABLE_DBSTAT_VTAB #include // std::string #endif +#endif #include "../schema/column.h" #include "../schema/table.h" diff --git a/dev/error_code.h b/dev/error_code.h index 41ad99f13..a5705d2a4 100644 --- a/dev/error_code.h +++ b/dev/error_code.h @@ -1,11 +1,13 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::error_code, std::system_error #include // std::string #include #include // std::ostringstream #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { diff --git a/dev/expression.h b/dev/expression.h index 496c643fe..40b4f5051 100644 --- a/dev/expression.h +++ b/dev/expression.h @@ -1,11 +1,13 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include #include // std::enable_if #include // std::move, std::forward, std::declval +#endif #include "functional/cxx_optional.h" -#include "functional/cxx_universal.h" // ::nullptr_t +#include "functional/cxx_universal.h" // std::nullptr_t #include "functional/cxx_type_traits_polyfill.h" #include "tags.h" #include "operators.h" @@ -35,7 +37,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { return {this->value, std::move(r)}; } - assign_t operator=(nullptr_t) const { + assign_t operator=(std::nullptr_t) const { return {this->value, nullptr}; } #ifdef SQLITE_ORM_OPTIONAL_SUPPORTED diff --git a/dev/expression_object_type.h b/dev/expression_object_type.h index 087602e3b..407e0ed57 100644 --- a/dev/expression_object_type.h +++ b/dev/expression_object_type.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::decay, std::remove_reference #include // std::reference_wrapper +#endif #include "type_traits.h" #include "prepared_statement.h" diff --git a/dev/field_printer.h b/dev/field_printer.h index 71d6aba15..1bf701627 100644 --- a/dev/field_printer.h +++ b/dev/field_printer.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::stringstream #include // std::vector @@ -9,8 +10,9 @@ #include // std::codecvt_utf8_utf16 #endif #include "functional/cxx_optional.h" +#endif -#include "functional/cxx_universal.h" // ::nullptr_t +#include "functional/cxx_universal.h" // std::nullptr_t #include "functional/cxx_type_traits_polyfill.h" #include "is_std_ptr.h" #include "type_traits.h" @@ -119,8 +121,8 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { }; #endif // SQLITE_ORM_OMITS_CODECVT template<> - struct field_printer { - std::string operator()(const nullptr_t&) const { + struct field_printer { + std::string operator()(const std::nullptr_t&) const { return "NULL"; } }; @@ -143,7 +145,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { if(t) { return field_printer()(*t); } else { - return field_printer{}(nullptr); + return field_printer{}(nullptr); } } }; diff --git a/dev/function.h b/dev/function.h index 2673de8b6..3b31a01e1 100644 --- a/dev/function.h +++ b/dev/function.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _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 #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include // std::copy_constructible @@ -7,8 +8,9 @@ #include // std::tuple, std::tuple_size, std::tuple_element #include // std::min, std::copy_n #include // std::move, std::forward +#endif -#include "functional/cxx_universal.h" // ::size_t, ::nullptr_t +#include "functional/cxx_universal.h" // ::size_t, std::nullptr_t #include "functional/cxx_type_traits_polyfill.h" #include "functional/cstring_literal.h" #include "functional/function_traits.h" @@ -240,10 +242,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // Always allow binding nullptr to a pointer argument template - constexpr bool is_same_pvt_v> = true; + constexpr bool is_same_pvt_v> = true; // Always allow binding nullptr to a pointer argument template - constexpr bool is_same_pvt_v, pointer_binding, void> = true; + constexpr bool is_same_pvt_v, pointer_binding, void> = true; template SQLITE_ORM_CONSTEVAL bool assert_same_pointer_data_type() { diff --git a/dev/functional/cstring_literal.h b/dev/functional/cstring_literal.h index db1d8471f..e9541ab79 100644 --- a/dev/functional/cstring_literal.h +++ b/dev/functional/cstring_literal.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include // std::index_sequence #include // std::copy_n #endif +#endif #include "cxx_universal.h" // ::size_t diff --git a/dev/functional/cxx_functional_polyfill.h b/dev/functional/cxx_functional_polyfill.h index 474ab2f38..1a238d5de 100644 --- a/dev/functional/cxx_functional_polyfill.h +++ b/dev/functional/cxx_functional_polyfill.h @@ -1,10 +1,14 @@ #pragma once +#ifdef _IMPORT_STD_MODULE +#include +#else #include #if __cpp_lib_invoke < 201411L #include // std::enable_if, std::is_member_object_pointer, std::is_member_function_pointer #endif #include // std::forward +#endif #include "cxx_type_traits_polyfill.h" #include "../member_traits/member_traits.h" diff --git a/dev/functional/cxx_optional.h b/dev/functional/cxx_optional.h index 627a4fb58..3b8609766 100644 --- a/dev/functional/cxx_optional.h +++ b/dev/functional/cxx_optional.h @@ -2,9 +2,13 @@ #include "cxx_core_features.h" +#ifdef _IMPORT_STD_MODULE +#include +#else #if SQLITE_ORM_HAS_INCLUDE() #include #endif +#endif #if __cpp_lib_optional >= 201606L #define SQLITE_ORM_OPTIONAL_SUPPORTED diff --git a/dev/functional/cxx_string_view.h b/dev/functional/cxx_string_view.h index 9fedcce7c..733ce3a8e 100644 --- a/dev/functional/cxx_string_view.h +++ b/dev/functional/cxx_string_view.h @@ -2,9 +2,13 @@ #include "cxx_core_features.h" +#ifdef _IMPORT_STD_MODULE +#include +#else #if SQLITE_ORM_HAS_INCLUDE() #include #endif +#endif #if __cpp_lib_string_view >= 201606L #define SQLITE_ORM_STRING_VIEW_SUPPORTED diff --git a/dev/functional/cxx_tuple_polyfill.h b/dev/functional/cxx_tuple_polyfill.h index e77fe2ae5..c5bc208e0 100644 --- a/dev/functional/cxx_tuple_polyfill.h +++ b/dev/functional/cxx_tuple_polyfill.h @@ -1,9 +1,13 @@ #pragma once +#ifdef _IMPORT_STD_MODULE +#include +#else #include // std::apply; std::tuple_size #if __cpp_lib_apply < 201603L #include // std::forward, std::index_sequence, std::make_index_sequence #endif +#endif #include "../functional/cxx_universal.h" // ::size_t #include "../functional/cxx_functional_polyfill.h" // std::invoke diff --git a/dev/functional/cxx_type_traits_polyfill.h b/dev/functional/cxx_type_traits_polyfill.h index e5c985696..dcd709137 100644 --- a/dev/functional/cxx_type_traits_polyfill.h +++ b/dev/functional/cxx_type_traits_polyfill.h @@ -1,5 +1,10 @@ #pragma once + +#ifdef _IMPORT_STD_MODULE +#include +#else #include +#endif #include "cxx_universal.h" #include "mpl/conditional.h" diff --git a/dev/functional/cxx_universal.h b/dev/functional/cxx_universal.h index dd2b4dc20..440fbe6d9 100644 --- a/dev/functional/cxx_universal.h +++ b/dev/functional/cxx_universal.h @@ -9,7 +9,9 @@ */ #include // alternative operator representations +#ifndef _IMPORT_STD_MODULE #include // sqlite_orm is using size_t, ptrdiff_t, nullptr_t everywhere, pull it in early +#endif // earlier clang versions didn't make nullptr_t available in the global namespace via stddef.h, // though it should have according to C++ documentation (see https://en.cppreference.com/w/cpp/types/nullptr_t#Notes). diff --git a/dev/functional/index_sequence_util.h b/dev/functional/index_sequence_util.h index cf51a23f1..8225463ae 100644 --- a/dev/functional/index_sequence_util.h +++ b/dev/functional/index_sequence_util.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::index_sequence +#endif #include "../functional/cxx_universal.h" // ::size_t diff --git a/dev/functional/mpl.h b/dev/functional/mpl.h index 06cb4b09e..e14f77fe5 100644 --- a/dev/functional/mpl.h +++ b/dev/functional/mpl.h @@ -28,12 +28,14 @@ * - "higher order" denotes a metafunction that operates on another metafunction (i.e. takes it as an argument). */ +#ifndef _IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::is_same, std::negation, std::conjunction, std::disjunction #ifdef SQLITE_ORM_RELAXED_CONSTEXPR_SUPPORTED #include #else #include #endif +#endif #include "cxx_universal.h" // ::size_t #include "cxx_type_traits_polyfill.h" diff --git a/dev/functional/static_magic.h b/dev/functional/static_magic.h index c736d4769..1a3114aae 100644 --- a/dev/functional/static_magic.h +++ b/dev/functional/static_magic.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #ifndef SQLITE_ORM_IF_CONSTEXPR_SUPPORTED #include // std::false_type, std::true_type, std::integral_constant #endif #include // std::forward +#endif namespace sqlite_orm { diff --git a/dev/get_prepared_statement.h b/dev/get_prepared_statement.h index fa8d26f66..ffea2568b 100644 --- a/dev/get_prepared_statement.h +++ b/dev/get_prepared_statement.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::is_same, std::remove_reference, std::remove_cvref #include // std::get +#endif #include "functional/cxx_universal.h" // ::size_t #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/implementations/column_definitions.h b/dev/implementations/column_definitions.h index 370deec55..6d4ab347d 100644 --- a/dev/implementations/column_definitions.h +++ b/dev/implementations/column_definitions.h @@ -4,7 +4,9 @@ */ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::make_unique +#endif #include "../functional/static_magic.h" #include "../tuple_helper/tuple_traits.h" diff --git a/dev/implementations/storage_definitions.h b/dev/implementations/storage_definitions.h index 80d777a21..9b9822951 100644 --- a/dev/implementations/storage_definitions.h +++ b/dev/implementations/storage_definitions.h @@ -4,11 +4,13 @@ */ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::is_same #include // std::stringstream #include // std::flush #include // std::reference_wrapper, std::cref #include // std::find_if, std::ranges::find +#endif #include "../type_traits.h" #include "../sqlite_schema_table.h" diff --git a/dev/implementations/table_definitions.h b/dev/implementations/table_definitions.h index eb983961a..477218587 100644 --- a/dev/implementations/table_definitions.h +++ b/dev/implementations/table_definitions.h @@ -4,9 +4,11 @@ */ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::decay_t #include // std::move #include // std::find_if, std::ranges::find +#endif #include "../functional/cxx_universal.h" // ::size_t #include "../type_printer.h" diff --git a/dev/indexed_column.h b/dev/indexed_column.h index 84e8785e1..34c148eaf 100644 --- a/dev/indexed_column.h +++ b/dev/indexed_column.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::move +#endif #include "functional/cxx_universal.h" #include "ast/where.h" diff --git a/dev/is_base_of_template.h b/dev/is_base_of_template.h index 788bb3f0b..96ffa74cc 100644 --- a/dev/is_base_of_template.h +++ b/dev/is_base_of_template.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::declval +#endif namespace sqlite_orm { diff --git a/dev/is_std_ptr.h b/dev/is_std_ptr.h index dca7b8140..cd9b78e06 100644 --- a/dev/is_std_ptr.h +++ b/dev/is_std_ptr.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { diff --git a/dev/journal_mode.h b/dev/journal_mode.h index d2dcd07c1..05f001c70 100644 --- a/dev/journal_mode.h +++ b/dev/journal_mode.h @@ -1,11 +1,13 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::back_inserter #include // std::string #include // std::unique_ptr #include // std::array #include // std::transform #include // std::toupper +#endif #if defined(_WINNT_) // DELETE is a macro defined in the Windows SDK (winnt.h) diff --git a/dev/limit_accessor.h b/dev/limit_accessor.h index e8404e823..fde2cd081 100644 --- a/dev/limit_accessor.h +++ b/dev/limit_accessor.h @@ -1,9 +1,11 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::map #include // std::function #include // std::shared_ptr +#endif #include "connection_holder.h" diff --git a/dev/mapped_iterator.h b/dev/mapped_iterator.h index 4b5d57ef8..fb8963623 100644 --- a/dev/mapped_iterator.h +++ b/dev/mapped_iterator.h @@ -1,11 +1,13 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::shared_ptr, std::make_shared #include // std::move #include // std::input_iterator_tag #include // std::system_error #include // std::bind +#endif #include "functional/cxx_universal.h" // ::ptrdiff_t #include "statement_finalizer.h" diff --git a/dev/mapped_type_proxy.h b/dev/mapped_type_proxy.h index b18eea0e6..3e58e045e 100644 --- a/dev/mapped_type_proxy.h +++ b/dev/mapped_type_proxy.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::remove_const +#endif #include "type_traits.h" #include "table_reference.h" diff --git a/dev/mapped_view.h b/dev/mapped_view.h index b2b61543a..a6410142e 100644 --- a/dev/mapped_view.h +++ b/dev/mapped_view.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include #include // std::forward, std::move +#endif #include "row_extractor.h" #include "mapped_iterator.h" diff --git a/dev/member_traits/member_traits.h b/dev/member_traits/member_traits.h index cb2042628..f8331dc1c 100644 --- a/dev/member_traits/member_traits.h +++ b/dev/member_traits/member_traits.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_function, std::true_type, std::false_type +#endif #include "../functional/cxx_universal.h" #include "../functional/cxx_type_traits_polyfill.h" diff --git a/dev/node_tuple.h b/dev/node_tuple.h index 1cf4729ee..a293f2289 100644 --- a/dev/node_tuple.h +++ b/dev/node_tuple.h @@ -1,10 +1,12 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if #include // std::tuple #include // std::pair #include // std::reference_wrapper #include "functional/cxx_optional.h" +#endif #include "functional/cxx_type_traits_polyfill.h" #include "tuple_helper/tuple_filter.h" diff --git a/dev/object_from_column_builder.h b/dev/object_from_column_builder.h index 4777cb7ae..ceb61a71a 100644 --- a/dev/object_from_column_builder.h +++ b/dev/object_from_column_builder.h @@ -1,8 +1,10 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::is_member_object_pointer #include // std::move +#endif #include "functional/static_magic.h" #include "member_traits/member_traits.h" diff --git a/dev/operators.h b/dev/operators.h index 90af21d76..0f47d6157 100644 --- a/dev/operators.h +++ b/dev/operators.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move +#endif #include "functional/cxx_type_traits_polyfill.h" #include "is_base_of_template.h" diff --git a/dev/order_by_serializer.h b/dev/order_by_serializer.h index f591cda0d..cbb80bd99 100644 --- a/dev/order_by_serializer.h +++ b/dev/order_by_serializer.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::stringstream +#endif namespace sqlite_orm { diff --git a/dev/pointer_value.h b/dev/pointer_value.h index a6cd86c47..77bf8b925 100644 --- a/dev/pointer_value.h +++ b/dev/pointer_value.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3020000 #include #include @@ -8,6 +9,7 @@ #include #endif #endif +#endif #include "functional/cstring_literal.h" #include "xdestroy_handling.h" diff --git a/dev/pragma.h b/dev/pragma.h index 29ef435e0..0a780e65c 100644 --- a/dev/pragma.h +++ b/dev/pragma.h @@ -1,12 +1,14 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::function #include // std::shared_ptr #include // std::vector #include #include // std::flush +#endif #include "error_code.h" #include "row_extractor.h" diff --git a/dev/prepared_statement.h b/dev/prepared_statement.h index 910f06614..dfcaecf37 100644 --- a/dev/prepared_statement.h +++ b/dev/prepared_statement.h @@ -1,12 +1,14 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::unique_ptr #include // std::iterator_traits #include // std::string #include // std::integral_constant, std::declval #include // std::move, std::forward, std::pair #include // std::tuple +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/result_set_iterator.h b/dev/result_set_iterator.h index e2430bc3b..7936dec43 100644 --- a/dev/result_set_iterator.h +++ b/dev/result_set_iterator.h @@ -1,9 +1,11 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::move #include // std::input_iterator_tag, std::default_sentinel_t #include // std::reference_wrapper +#endif #include "functional/cxx_universal.h" // ::ptrdiff_t #include "statement_finalizer.h" diff --git a/dev/result_set_view.h b/dev/result_set_view.h index 776e021c8..58749230b 100644 --- a/dev/result_set_view.h +++ b/dev/result_set_view.h @@ -1,12 +1,14 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::move, std::remove_cvref #include // std::reference_wrapper #if defined(SQLITE_ORM_SENTINEL_BASED_FOR_SUPPORTED) && defined(SQLITE_ORM_DEFAULT_COMPARISONS_SUPPORTED) && \ defined(SQLITE_ORM_CPP20_RANGES_SUPPORTED) #include // std::ranges::view_interface #endif +#endif #include "functional/cxx_type_traits_polyfill.h" #include "row_extractor.h" diff --git a/dev/row_extractor.h b/dev/row_extractor.h index 3f5a74a2a..f9c0ada47 100644 --- a/dev/row_extractor.h +++ b/dev/row_extractor.h @@ -1,6 +1,7 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::enable_if_t, std::is_arithmetic, std::is_same, std::enable_if #include // std::atof, std::atoi, std::atoll #include // std::strlen @@ -17,8 +18,9 @@ #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include #endif +#endif -#include "functional/cxx_universal.h" // ::nullptr_t, ::size_t +#include "functional/cxx_universal.h" // std::nullptr_t, ::size_t #include "functional/cxx_functional_polyfill.h" #include "functional/static_magic.h" #include "tuple_helper/tuple_transformer.h" @@ -370,16 +372,16 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #endif // SQLITE_ORM_OPTIONAL_SUPPORTED template<> - struct row_extractor { - nullptr_t extract(const char* /*columnText*/) const { + struct row_extractor { + std::nullptr_t extract(const char* /*columnText*/) const { return nullptr; } - nullptr_t extract(sqlite3_stmt*, int /*columnIndex*/) const { + std::nullptr_t extract(sqlite3_stmt*, int /*columnIndex*/) const { return nullptr; } - nullptr_t extract(sqlite3_value*) const { + std::nullptr_t extract(sqlite3_value*) const { return nullptr; } }; diff --git a/dev/rowid.h b/dev/rowid.h index a8994fe79..9be5bef1b 100644 --- a/dev/rowid.h +++ b/dev/rowid.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { diff --git a/dev/schema/column.h b/dev/schema/column.h index 2610fa748..e5822b15b 100644 --- a/dev/schema/column.h +++ b/dev/schema/column.h @@ -1,10 +1,12 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::tuple #include // std::string #include // std::unique_ptr #include // std::is_same, std::is_member_object_pointer #include // std::move +#endif #include "../functional/cxx_universal.h" #include "../functional/cxx_type_traits_polyfill.h" diff --git a/dev/schema/index.h b/dev/schema/index.h index 1814faaf7..0455f2e84 100644 --- a/dev/schema/index.h +++ b/dev/schema/index.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::tuple, std::make_tuple, std::declval, std::tuple_element_t #include // std::string #include // std::forward +#endif #include "../functional/cxx_universal.h" #include "../tuple_helper/tuple_traits.h" diff --git a/dev/schema/table.h b/dev/schema/table.h index 90be234a0..6a10f2720 100644 --- a/dev/schema/table.h +++ b/dev/schema/table.h @@ -1,10 +1,12 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::remove_const, std::is_member_pointer, std::true_type, std::false_type #include // std::vector #include // std::tuple_element #include // std::forward, std::move +#endif #include "../functional/cxx_universal.h" // ::size_t #include "../functional/cxx_type_traits_polyfill.h" diff --git a/dev/schema/triggers.h b/dev/schema/triggers.h index b924219a8..ad8bca455 100644 --- a/dev/schema/triggers.h +++ b/dev/schema/triggers.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include #include #include #include +#endif #include "../functional/cxx_universal.h" #include "../optional_container.h" diff --git a/dev/select_constraints.h b/dev/select_constraints.h index 1e84668ce..9dd5158df 100644 --- a/dev/select_constraints.h +++ b/dev/select_constraints.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include #endif @@ -7,6 +8,7 @@ #include // std::string #include // std::move #include // std::tuple, std::get, std::tuple_size +#endif #include "functional/cxx_optional.h" #include "functional/cxx_universal.h" // ::size_t diff --git a/dev/serialize_result_type.h b/dev/serialize_result_type.h index ac5f606b8..271b5a868 100644 --- a/dev/serialize_result_type.h +++ b/dev/serialize_result_type.h @@ -1,9 +1,11 @@ #pragma once #include "functional/cxx_string_view.h" +#ifndef _IMPORT_STD_MODULE #ifndef SQLITE_ORM_STRING_VIEW_SUPPORTED #include // std::string #endif +#endif namespace sqlite_orm { namespace internal { diff --git a/dev/serializing_util.h b/dev/serializing_util.h index 00dfc2097..ae4d1ea74 100644 --- a/dev/serializing_util.h +++ b/dev/serializing_util.h @@ -1,11 +1,13 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::index_sequence #include #include #include #include #include // std::exchange, std::tuple_size, std::make_index_sequence +#endif #include "functional/cxx_universal.h" // ::size_t #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/sqlite_schema_table.h b/dev/sqlite_schema_table.h index da1818826..f1829d670 100644 --- a/dev/sqlite_schema_table.h +++ b/dev/sqlite_schema_table.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif #include "schema/column.h" #include "schema/table.h" diff --git a/dev/statement_binder.h b/dev/statement_binder.h index 20cedc947..0872bf949 100644 --- a/dev/statement_binder.h +++ b/dev/statement_binder.h @@ -1,6 +1,7 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::enable_if_t, std::is_arithmetic, std::is_same, std::true_type, std::false_type, std::make_index_sequence, std::index_sequence #include // std::default_delete #include // std::string, std::wstring @@ -14,6 +15,7 @@ #include // std::wstring_convert #include // std::codecvt_utf8_utf16 #endif +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" @@ -201,15 +203,15 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #endif /** - * Specialization for nullptr_t. + * Specialization for std::nullptr_t. */ template<> - struct statement_binder { - int bind(sqlite3_stmt* stmt, int index, const nullptr_t&) const { + struct statement_binder { + int bind(sqlite3_stmt* stmt, int index, const std::nullptr_t&) const { return sqlite3_bind_null(stmt, index); } - void result(sqlite3_context* context, const nullptr_t&) const { + void result(sqlite3_context* context, const std::nullptr_t&) const { sqlite3_result_null(context); } }; @@ -241,7 +243,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { if(value) { return statement_binder().bind(stmt, index, *value); } else { - return statement_binder().bind(stmt, index, nullptr); + return statement_binder().bind(stmt, index, nullptr); } } }; diff --git a/dev/statement_finalizer.h b/dev/statement_finalizer.h index a9d2d98e9..8a72c469e 100644 --- a/dev/statement_finalizer.h +++ b/dev/statement_finalizer.h @@ -1,8 +1,10 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::unique_ptr #include // std::integral_constant +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { diff --git a/dev/statement_serializer.h b/dev/statement_serializer.h index c1f0f2c26..68e954df6 100644 --- a/dev/statement_serializer.h +++ b/dev/statement_serializer.h @@ -1,5 +1,6 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::stringstream #include // std::string #include // std::enable_if, std::remove_pointer @@ -11,10 +12,11 @@ #include #include #include // std::list +#endif #include "functional/cxx_string_view.h" #include "functional/cxx_optional.h" -#include "functional/cxx_universal.h" // ::nullptr_t, ::size_t +#include "functional/cxx_universal.h" // std::nullptr_t, ::size_t #include "functional/cxx_functional_polyfill.h" #include "functional/mpl.h" #include "tuple_helper/tuple_filter.h" @@ -137,7 +139,7 @@ namespace sqlite_orm { template std::string do_serialize(const pointer_binding&) const { // always serialize null (security reasons) - return field_printer{}(nullptr); + return field_printer{}(nullptr); } #endif }; diff --git a/dev/storage.h b/dev/storage.h index 4c33dae6e..fc34576d2 100644 --- a/dev/storage.h +++ b/dev/storage.h @@ -1,6 +1,7 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::unique_ptr/shared_ptr, std::make_unique/std::make_shared #include // std::system_error #include // std::string @@ -13,6 +14,7 @@ #include // std::tuple_size, std::tuple, std::make_tuple, std::tie #include // std::forward, std::pair #include // std::for_each, std::ranges::for_each +#endif #include "functional/cxx_optional.h" #include "functional/cxx_universal.h" diff --git a/dev/storage_base.h b/dev/storage_base.h index 0ff06a637..9bde0023d 100644 --- a/dev/storage_base.h +++ b/dev/storage_base.h @@ -1,6 +1,7 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::allocator #include // std::function, std::bind, std::bind_front #include // std::string @@ -14,6 +15,7 @@ #include // std::map #include // std::is_same #include // std::find_if, std::ranges::find +#endif #include "functional/cxx_universal.h" // ::size_t #include "functional/cxx_tuple_polyfill.h" // std::apply diff --git a/dev/storage_impl.h b/dev/storage_impl.h index d364daba9..643f93dc8 100644 --- a/dev/storage_impl.h +++ b/dev/storage_impl.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif #include "functional/cxx_universal.h" // ::size_t #include "functional/static_magic.h" diff --git a/dev/storage_lookup.h b/dev/storage_lookup.h index 4992e602e..d6563b23e 100644 --- a/dev/storage_lookup.h +++ b/dev/storage_lookup.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::remove_const, std::enable_if, std::is_base_of, std::is_void #include #include // std::index_sequence, std::make_index_sequence +#endif #include "functional/cxx_universal.h" // ::size_t #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/storage_traits.h b/dev/storage_traits.h index 4fc1f33ed..f5e8df93e 100644 --- a/dev/storage_traits.h +++ b/dev/storage_traits.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::tuple +#endif #include "functional/cxx_type_traits_polyfill.h" #include "tuple_helper/tuple_filter.h" diff --git a/dev/sync_schema_result.h b/dev/sync_schema_result.h index e8d162edd..27d498f15 100644 --- a/dev/sync_schema_result.h +++ b/dev/sync_schema_result.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { diff --git a/dev/table_info.h b/dev/table_info.h index 0fc5fa614..3d138cab3 100644 --- a/dev/table_info.h +++ b/dev/table_info.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif #include "functional/cxx_universal.h" diff --git a/dev/table_name_collector.h b/dev/table_name_collector.h index 47429675f..ee2f6377f 100644 --- a/dev/table_name_collector.h +++ b/dev/table_name_collector.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::set #include // std::string #include // std::pair, std::move +#endif #include "functional/cxx_type_traits_polyfill.h" #include "type_traits.h" diff --git a/dev/table_reference.h b/dev/table_reference.h index 412f2838b..4bbf0fb45 100644 --- a/dev/table_reference.h +++ b/dev/table_reference.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::remove_const, std::type_identity #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include #endif +#endif #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/table_type_of.h b/dev/table_type_of.h index 52604d788..16262bfdd 100644 --- a/dev/table_type_of.h +++ b/dev/table_type_of.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible +#endif namespace sqlite_orm { diff --git a/dev/transaction_guard.h b/dev/transaction_guard.h index 3ad6d7785..85ba887b1 100644 --- a/dev/transaction_guard.h +++ b/dev/transaction_guard.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::function #include // std::move +#endif #include "connection_holder.h" diff --git a/dev/tuple_helper/same_or_void.h b/dev/tuple_helper/same_or_void.h index c0bd482b1..5979b856a 100644 --- a/dev/tuple_helper/same_or_void.h +++ b/dev/tuple_helper/same_or_void.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::common_type +#endif namespace sqlite_orm { namespace internal { diff --git a/dev/tuple_helper/tuple_filter.h b/dev/tuple_helper/tuple_filter.h index 159a50b0f..ea47314ee 100644 --- a/dev/tuple_helper/tuple_filter.h +++ b/dev/tuple_helper/tuple_filter.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::integral_constant, std::index_sequence, std::conditional, std::declval #include // std::tuple, std::tuple_cat, std::tuple_element +#endif #include "../functional/cxx_universal.h" // ::size_t #include "../functional/mpl/conditional.h" diff --git a/dev/tuple_helper/tuple_fy.h b/dev/tuple_helper/tuple_fy.h index 3e2ec3b7d..0001a2710 100644 --- a/dev/tuple_helper/tuple_fy.h +++ b/dev/tuple_helper/tuple_fy.h @@ -1,6 +1,8 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include +#endif namespace sqlite_orm { diff --git a/dev/tuple_helper/tuple_iteration.h b/dev/tuple_helper/tuple_iteration.h index afea35007..612db7b97 100644 --- a/dev/tuple_helper/tuple_iteration.h +++ b/dev/tuple_helper/tuple_iteration.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::get, std::tuple_element, std::tuple_size #include // std::index_sequence, std::make_index_sequence #include // std::forward, std::move +#endif #include "../functional/cxx_universal.h" // ::size_t diff --git a/dev/tuple_helper/tuple_transformer.h b/dev/tuple_helper/tuple_transformer.h index a4333a0d3..874e83733 100644 --- a/dev/tuple_helper/tuple_transformer.h +++ b/dev/tuple_helper/tuple_transformer.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _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 +#endif #include "../functional/cxx_universal.h" // ::size_t #include "../functional/cxx_type_traits_polyfill.h" diff --git a/dev/type_is_nullable.h b/dev/type_is_nullable.h index b959a360d..5bed52890 100644 --- a/dev/type_is_nullable.h +++ b/dev/type_is_nullable.h @@ -1,7 +1,9 @@ #pragma once +#ifndef _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" diff --git a/dev/type_printer.h b/dev/type_printer.h index b5cfe08b0..5eb9083de 100644 --- a/dev/type_printer.h +++ b/dev/type_printer.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::shared_ptr, std::unique_ptr #include // std::vector +#endif #include "functional/cxx_optional.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/type_traits.h b/dev/type_traits.h index 26fc97815..35b9aaf4c 100644 --- a/dev/type_traits.h +++ b/dev/type_traits.h @@ -1,11 +1,13 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::is_empty, std::is_aggregate #if __cpp_lib_unwrap_ref >= 201811L #include // std::reference_wrapper #else #include // std::reference_wrapper #endif +#endif #include "functional/cxx_core_features.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/udf_proxy.h b/dev/udf_proxy.h index cf152de95..ad6bd1471 100644 --- a/dev/udf_proxy.h +++ b/dev/udf_proxy.h @@ -1,6 +1,7 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // assert macro #include // std::true_type, std::false_type #include // std::bad_alloc @@ -8,6 +9,7 @@ #include // std::string #include // std::function #include // std::move, std::pair +#endif #include "error_code.h" diff --git a/dev/util.h b/dev/util.h index 3ab47d7e0..650924406 100644 --- a/dev/util.h +++ b/dev/util.h @@ -1,8 +1,10 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::move +#endif #include "error_code.h" diff --git a/dev/values.h b/dev/values.h index 2ddea6b30..8fdf0dd32 100644 --- a/dev/values.h +++ b/dev/values.h @@ -1,8 +1,10 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::vector #include // std::tuple #include // std::forward +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" diff --git a/dev/values_to_tuple.h b/dev/values_to_tuple.h index 76f7af3b6..b8f944cf6 100644 --- a/dev/values_to_tuple.h +++ b/dev/values_to_tuple.h @@ -1,8 +1,10 @@ #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::index_sequence, std::make_index_sequence #include // std::tuple, std::tuple_size, std::tuple_element +#endif #include "functional/cxx_universal.h" // ::size_t #include "functional/cxx_functional_polyfill.h" diff --git a/dev/xdestroy_handling.h b/dev/xdestroy_handling.h index f9d8e63ca..eefd2b41e 100644 --- a/dev/xdestroy_handling.h +++ b/dev/xdestroy_handling.h @@ -1,9 +1,11 @@ #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::integral_constant #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include #endif +#endif #include "functional/cxx_universal.h" #include "functional/cxx_type_traits_polyfill.h" @@ -15,7 +17,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { SQLITE_ORM_INLINE_VAR constexpr null_xdestroy_t null_xdestroy_f{}; } -_EXPORT_SQLITE_ORM namespace sqlite_orm { +namespace sqlite_orm { namespace internal { #ifdef SQLITE_ORM_CONCEPTS_SUPPORTED /** diff --git a/examples/iteration.cpp b/examples/iteration.cpp index e83ae3a09..2398f2526 100644 --- a/examples/iteration.cpp +++ b/examples/iteration.cpp @@ -3,7 +3,9 @@ #include #include #include -#include +//#include +//import std; +import sqlite_orm; using std::cout; using std::endl; diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index ca7062344..bf83f959b 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -22,7 +22,9 @@ __pragma(push_macro("max")) */ #include // alternative operator representations +#ifndef _IMPORT_STD_MODULE #include // sqlite_orm is using size_t, ptrdiff_t, nullptr_t everywhere, pull it in early +#endif // earlier clang versions didn't make nullptr_t available in the global namespace via stddef.h, // though it should have according to C++ documentation (see https://en.cppreference.com/w/cpp/types/nullptr_t#Notes). @@ -285,6 +287,7 @@ namespace sqlite_orm { #pragma once #include +#ifndef _IMPORT_STD_MODULE #include // std::unique_ptr/shared_ptr, std::make_unique/std::make_shared #include // std::system_error #include // std::string @@ -297,13 +300,18 @@ namespace sqlite_orm { #include // std::tuple_size, std::tuple, std::make_tuple, std::tie #include // std::forward, std::pair #include // std::for_each, std::ranges::for_each +#endif // #include "functional/cxx_optional.h" // #include "cxx_core_features.h" +#ifdef _IMPORT_STD_MODULE +#include +#else #if SQLITE_ORM_HAS_INCLUDE() #include #endif +#endif #if __cpp_lib_optional >= 201606L #define SQLITE_ORM_OPTIONAL_SUPPORTED @@ -313,15 +321,23 @@ namespace sqlite_orm { // #include "functional/cxx_functional_polyfill.h" +#ifdef _IMPORT_STD_MODULE +#include +#else #include #if __cpp_lib_invoke < 201411L #include // std::enable_if, std::is_member_object_pointer, std::is_member_function_pointer #endif #include // std::forward +#endif // #include "cxx_type_traits_polyfill.h" +#ifdef _IMPORT_STD_MODULE +#include +#else #include +#endif // #include "cxx_universal.h" @@ -510,7 +526,9 @@ namespace sqlite_orm { // #include "../member_traits/member_traits.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_function, std::true_type, std::false_type +#endif // #include "../functional/cxx_universal.h" @@ -676,10 +694,12 @@ namespace sqlite_orm { // #include "functional/static_magic.h" +#ifndef _IMPORT_STD_MODULE #ifndef SQLITE_ORM_IF_CONSTEXPR_SUPPORTED #include // std::false_type, std::true_type, std::integral_constant #endif #include // std::forward +#endif namespace sqlite_orm { @@ -784,12 +804,14 @@ namespace sqlite_orm { * - "higher order" denotes a metafunction that operates on another metafunction (i.e. takes it as an argument). */ +#ifndef _IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::is_same, std::negation, std::conjunction, std::disjunction #ifdef SQLITE_ORM_RELAXED_CONSTEXPR_SUPPORTED #include #else #include #endif +#endif // #include "cxx_universal.h" // ::size_t @@ -1369,8 +1391,10 @@ namespace sqlite_orm { // #include "tuple_helper/tuple_filter.h" +#ifndef _IMPORT_STD_MODULE #include // std::integral_constant, std::index_sequence, std::conditional, std::declval #include // std::tuple, std::tuple_cat, std::tuple_element +#endif // #include "../functional/cxx_universal.h" // ::size_t @@ -1378,7 +1402,9 @@ namespace sqlite_orm { // #include "../functional/index_sequence_util.h" +#ifndef _IMPORT_STD_MODULE #include // std::index_sequence +#endif // #include "../functional/cxx_universal.h" // ::size_t @@ -1533,8 +1559,10 @@ namespace sqlite_orm { // #include "tuple_helper/tuple_transformer.h" +#ifndef _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 +#endif // #include "../functional/cxx_universal.h" // ::size_t @@ -1652,9 +1680,11 @@ namespace sqlite_orm { // #include "tuple_helper/tuple_iteration.h" +#ifndef _IMPORT_STD_MODULE #include // std::get, std::tuple_element, std::tuple_size #include // std::index_sequence, std::make_index_sequence #include // std::forward, std::move +#endif // #include "../functional/cxx_universal.h" // ::size_t @@ -1743,12 +1773,14 @@ namespace sqlite_orm { // #include "type_traits.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::is_empty, std::is_aggregate #if __cpp_lib_unwrap_ref >= 201811L #include // std::reference_wrapper #else #include // std::reference_wrapper #endif +#endif // #include "functional/cxx_core_features.h" @@ -1889,6 +1921,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "alias.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same #include // std::make_index_sequence, std::move #include // std::string @@ -1896,6 +1929,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #endif +#endif // #include "functional/cxx_type_traits_polyfill.h" @@ -1903,10 +1937,12 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "functional/cstring_literal.h" +#ifndef _IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include // std::index_sequence #include // std::copy_n #endif +#endif // #include "cxx_universal.h" // ::size_t @@ -1941,10 +1977,12 @@ namespace sqlite_orm::internal { // #include "alias_traits.h" +#ifndef _IMPORT_STD_MODULE #include // std::is_base_of, std::is_same #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include #endif +#endif // #include "functional/cxx_universal.h" @@ -1954,10 +1992,12 @@ namespace sqlite_orm::internal { // #include "table_reference.h" +#ifndef _IMPORT_STD_MODULE #include // std::remove_const, std::type_identity #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include #endif +#endif // #include "functional/cxx_type_traits_polyfill.h" @@ -2118,7 +2158,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "table_type_of.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible +#endif namespace sqlite_orm { @@ -2214,8 +2256,10 @@ namespace sqlite_orm { // #include "column_pointer.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_convertible #include // std::move +#endif // #include "functional/cxx_core_features.h" @@ -2857,11 +2901,13 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "error_code.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::error_code, std::system_error #include // std::string #include #include // std::ostringstream #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { @@ -3025,9 +3071,11 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "type_printer.h" +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::shared_ptr, std::unique_ptr #include // std::vector +#endif // #include "functional/cxx_optional.h" // #include "functional/cxx_type_traits_polyfill.h" @@ -3036,8 +3084,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "is_std_ptr.h" +#ifndef _IMPORT_STD_MODULE #include #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { @@ -3140,11 +3190,13 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "constraints.h" +#ifndef _IMPORT_STD_MODULE #include // std::is_base_of, std::false_type, std::true_type #include // std::system_error #include // std::ostream #include // std::string #include // std::tuple +#endif // #include "functional/cxx_universal.h" @@ -3154,7 +3206,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "tuple_helper/same_or_void.h" +#ifndef _IMPORT_STD_MODULE #include // std::common_type +#endif namespace sqlite_orm { namespace internal { @@ -3853,6 +3907,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "field_printer.h" +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::stringstream #include // std::vector @@ -3863,8 +3918,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #endif // #include "functional/cxx_optional.h" +#endif + // #include "functional/cxx_universal.h" -// ::nullptr_t +// std::nullptr_t // #include "functional/cxx_type_traits_polyfill.h" // #include "is_std_ptr.h" @@ -3975,8 +4032,8 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { }; #endif // SQLITE_ORM_OMITS_CODECVT template<> - struct field_printer { - std::string operator()(const nullptr_t&) const { + struct field_printer { + std::string operator()(const std::nullptr_t&) const { return "NULL"; } }; @@ -3999,7 +4056,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { if(t) { return field_printer()(*t); } else { - return field_printer{}(nullptr); + return field_printer{}(nullptr); } } }; @@ -4025,7 +4082,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "rowid.h" +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { @@ -4095,14 +4154,18 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "operators.h" +#ifndef _IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move +#endif // #include "functional/cxx_type_traits_polyfill.h" // #include "is_base_of_template.h" +#ifndef _IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::declval +#endif namespace sqlite_orm { @@ -4147,17 +4210,23 @@ namespace sqlite_orm { // #include "cxx_core_features.h" +#ifdef _IMPORT_STD_MODULE +#include +#else #if SQLITE_ORM_HAS_INCLUDE() #include #endif +#endif #if __cpp_lib_string_view >= 201606L #define SQLITE_ORM_STRING_VIEW_SUPPORTED #endif +#ifndef _IMPORT_STD_MODULE #ifndef SQLITE_ORM_STRING_VIEW_SUPPORTED #include // std::string #endif +#endif namespace sqlite_orm { namespace internal { @@ -4439,6 +4508,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "select_constraints.h" +#ifndef _IMPORT_STD_MODULE #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include #endif @@ -4446,6 +4516,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #include // std::string #include // std::move #include // std::tuple, std::get, std::tuple_size +#endif // #include "functional/cxx_optional.h" // #include "functional/cxx_universal.h" @@ -4496,8 +4567,10 @@ namespace sqlite_orm { // #include "ast/where.h" +#ifndef _IMPORT_STD_MODULE #include // std::false_type, std::true_type #include // std::move +#endif // #include "../functional/cxx_universal.h" @@ -4552,9 +4625,11 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "ast/group_by.h" +#ifndef _IMPORT_STD_MODULE #include // std::tuple, std::make_tuple #include // std::true_type, std::false_type #include // std::forward, std::move +#endif // #include "../functional/cxx_type_traits_polyfill.h" @@ -4602,11 +4677,13 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "core_functions.h" +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::make_tuple, std::tuple_size #include // std::forward, std::is_base_of, std::enable_if #include // std::unique_ptr #include // std::vector +#endif // #include "functional/cxx_type_traits_polyfill.h" @@ -4618,6 +4695,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "conditions.h" +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::enable_if, std::is_same, std::remove_const #include // std::vector @@ -4625,6 +4703,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #include // std::move, std::forward #include // std::stringstream #include // std::flush +#endif // #include "functional/cxx_universal.h" @@ -4689,13 +4768,15 @@ namespace sqlite_orm { // #include "expression.h" +#ifndef _IMPORT_STD_MODULE #include #include // std::enable_if #include // std::move, std::forward, std::declval +#endif // #include "functional/cxx_optional.h" // #include "functional/cxx_universal.h" -// ::nullptr_t +// std::nullptr_t // #include "functional/cxx_type_traits_polyfill.h" // #include "tags.h" @@ -4727,7 +4808,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { return {this->value, std::move(r)}; } - assign_t operator=(nullptr_t) const { + assign_t operator=(std::nullptr_t) const { return {this->value, nullptr}; } #ifdef SQLITE_ORM_OPTIONAL_SUPPORTED @@ -8194,6 +8275,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "cte_moniker.h" +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include @@ -8203,6 +8285,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #include // std::ignore #include #endif +#endif // #include "functional/cxx_universal.h" @@ -8287,11 +8370,13 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "schema/column.h" +#ifndef _IMPORT_STD_MODULE #include // std::tuple #include // std::string #include // std::unique_ptr #include // std::is_same, std::is_member_object_pointer #include // std::move +#endif // #include "../functional/cxx_universal.h" @@ -8307,8 +8392,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "../type_is_nullable.h" +#ifndef _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" @@ -9320,6 +9407,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "statement_binder.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::enable_if_t, std::is_arithmetic, std::is_same, std::true_type, std::false_type, std::make_index_sequence, std::index_sequence #include // std::default_delete #include // std::string, std::wstring @@ -9334,6 +9422,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #include // std::wstring_convert #include // std::codecvt_utf8_utf16 #endif +#endif // #include "functional/cxx_universal.h" @@ -9351,7 +9440,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "arithmetic_tag.h" +#ifndef _IMPORT_STD_MODULE #include // std::is_integral +#endif // #include "functional/mpl/conditional.h" @@ -9375,10 +9466,12 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "xdestroy_handling.h" +#ifndef _IMPORT_STD_MODULE #include // std::integral_constant #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include #endif +#endif // #include "functional/cxx_universal.h" @@ -9391,7 +9484,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { SQLITE_ORM_INLINE_VAR constexpr null_xdestroy_t null_xdestroy_f{}; } -_EXPORT_SQLITE_ORM namespace sqlite_orm { +namespace sqlite_orm { namespace internal { #ifdef SQLITE_ORM_CONCEPTS_SUPPORTED /** @@ -9627,6 +9720,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "pointer_value.h" +#ifndef _IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3020000 #include #include @@ -9635,6 +9729,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #include #endif #endif +#endif // #include "functional/cstring_literal.h" @@ -10102,15 +10197,15 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #endif /** - * Specialization for nullptr_t. + * Specialization for std::nullptr_t. */ template<> - struct statement_binder { - int bind(sqlite3_stmt* stmt, int index, const nullptr_t&) const { + struct statement_binder { + int bind(sqlite3_stmt* stmt, int index, const std::nullptr_t&) const { return sqlite3_bind_null(stmt, index); } - void result(sqlite3_context* context, const nullptr_t&) const { + void result(sqlite3_context* context, const std::nullptr_t&) const { sqlite3_result_null(context); } }; @@ -10142,7 +10237,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { if(value) { return statement_binder().bind(stmt, index, *value); } else { - return statement_binder().bind(stmt, index, nullptr); + return statement_binder().bind(stmt, index, nullptr); } } }; @@ -10272,11 +10367,13 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "column_result.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic, std::is_base_of #include // std::reference_wrapper +#endif // #include "functional/cxx_universal.h" -// ::nullptr_t +// std::nullptr_t // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/mpl.h" @@ -10285,7 +10382,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "tuple_helper/tuple_fy.h" +#ifndef _IMPORT_STD_MODULE #include +#endif namespace sqlite_orm { @@ -10317,7 +10416,9 @@ namespace sqlite_orm { // #include "mapped_type_proxy.h" +#ifndef _IMPORT_STD_MODULE #include // std::remove_const +#endif // #include "type_traits.h" @@ -10404,10 +10505,12 @@ namespace sqlite_orm { // #include "cte_types.h" +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #include #endif +#endif // #include "functional/cxx_core_features.h" @@ -10468,7 +10571,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "storage_traits.h" +#ifndef _IMPORT_STD_MODULE #include // std::tuple +#endif // #include "functional/cxx_type_traits_polyfill.h" @@ -10480,9 +10585,11 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "storage_lookup.h" +#ifndef _IMPORT_STD_MODULE #include // std::true_type, std::false_type, std::remove_const, std::enable_if, std::is_base_of, std::is_void #include #include // std::index_sequence, std::make_index_sequence +#endif // #include "functional/cxx_universal.h" // ::size_t @@ -10686,6 +10793,7 @@ namespace sqlite_orm { // #include "function.h" +#ifndef _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 #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include // std::copy_constructible @@ -10693,9 +10801,10 @@ namespace sqlite_orm { #include // std::tuple, std::tuple_size, std::tuple_element #include // std::min, std::copy_n #include // std::move, std::forward +#endif // #include "functional/cxx_universal.h" -// ::size_t, ::nullptr_t +// ::size_t, std::nullptr_t // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/cstring_literal.h" @@ -11016,10 +11125,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // Always allow binding nullptr to a pointer argument template - constexpr bool is_same_pvt_v> = true; + constexpr bool is_same_pvt_v> = true; // Always allow binding nullptr to a pointer argument template - constexpr bool is_same_pvt_v, pointer_binding, void> = true; + constexpr bool is_same_pvt_v, pointer_binding, void> = true; template SQLITE_ORM_CONSTEVAL bool assert_same_pointer_data_type() { @@ -11455,8 +11564,8 @@ namespace sqlite_orm { }; template - struct column_result_t { - using type = nullptr_t; + struct column_result_t { + using type = std::nullptr_t; }; template @@ -11673,7 +11782,9 @@ namespace sqlite_orm { // #include "sync_schema_result.h" +#ifndef _IMPORT_STD_MODULE #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { @@ -11735,7 +11846,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "table_info.h" +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif // #include "functional/cxx_universal.h" @@ -11788,7 +11901,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "storage_impl.h" +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif // #include "functional/cxx_universal.h" // ::size_t @@ -11812,11 +11927,13 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "schema/table.h" +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::remove_const, std::is_member_pointer, std::true_type, std::false_type #include // std::vector #include // std::tuple_element #include // std::forward, std::move +#endif // #include "../functional/cxx_universal.h" // ::size_t @@ -11867,9 +11984,11 @@ namespace sqlite_orm { // #include "index.h" +#ifndef _IMPORT_STD_MODULE #include // std::tuple, std::make_tuple, std::declval, std::tuple_element_t #include // std::string #include // std::forward +#endif // #include "../functional/cxx_universal.h" @@ -11877,8 +11996,10 @@ namespace sqlite_orm { // #include "../indexed_column.h" +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::move +#endif // #include "functional/cxx_universal.h" @@ -12579,12 +12700,14 @@ namespace sqlite_orm { // #include "journal_mode.h" +#ifndef _IMPORT_STD_MODULE #include // std::back_inserter #include // std::string #include // std::unique_ptr #include // std::array #include // std::transform #include // std::toupper +#endif #if defined(_WINNT_) // DELETE is a macro defined in the Windows SDK (winnt.h) @@ -12653,12 +12776,15 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "mapped_view.h" +#ifndef _IMPORT_STD_MODULE #include #include // std::forward, std::move +#endif // #include "row_extractor.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::enable_if_t, std::is_arithmetic, std::is_same, std::enable_if #include // std::atof, std::atoi, std::atoll #include // std::strlen @@ -12675,9 +12801,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include #endif +#endif // #include "functional/cxx_universal.h" -// ::nullptr_t, ::size_t +// std::nullptr_t, ::size_t // #include "functional/cxx_functional_polyfill.h" // #include "functional/static_magic.h" @@ -13038,16 +13165,16 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #endif // SQLITE_ORM_OPTIONAL_SUPPORTED template<> - struct row_extractor { - nullptr_t extract(const char* /*columnText*/) const { + struct row_extractor { + std::nullptr_t extract(const char* /*columnText*/) const { return nullptr; } - nullptr_t extract(sqlite3_stmt*, int /*columnIndex*/) const { + std::nullptr_t extract(sqlite3_stmt*, int /*columnIndex*/) const { return nullptr; } - nullptr_t extract(sqlite3_value*) const { + std::nullptr_t extract(sqlite3_value*) const { return nullptr; } }; @@ -13223,19 +13350,23 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "mapped_iterator.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::shared_ptr, std::make_shared #include // std::move #include // std::input_iterator_tag #include // std::system_error #include // std::bind +#endif // #include "functional/cxx_universal.h" // ::ptrdiff_t // #include "statement_finalizer.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::unique_ptr #include // std::integral_constant +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { @@ -13251,8 +13382,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "object_from_column_builder.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::is_member_object_pointer #include // std::move +#endif // #include "functional/static_magic.h" @@ -13342,8 +13475,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "util.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::move +#endif // #include "error_code.h" @@ -13576,8 +13711,10 @@ namespace sqlite_orm { // #include "ast_iterator.h" +#ifndef _IMPORT_STD_MODULE #include // std::vector #include // std::reference_wrapper +#endif // #include "tuple_helper/tuple_iteration.h" @@ -13596,12 +13733,14 @@ namespace sqlite_orm { // #include "prepared_statement.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::unique_ptr #include // std::iterator_traits #include // std::string #include // std::integral_constant, std::declval #include // std::move, std::forward, std::pair #include // std::tuple +#endif // #include "functional/cxx_universal.h" @@ -13614,8 +13753,10 @@ namespace sqlite_orm { // #include "connection_holder.h" #include +#ifndef _IMPORT_STD_MODULE #include #include // std::string +#endif // #include "error_code.h" @@ -13698,9 +13839,11 @@ namespace sqlite_orm { // #include "values.h" +#ifndef _IMPORT_STD_MODULE #include // std::vector #include // std::tuple #include // std::forward +#endif // #include "functional/cxx_universal.h" @@ -13747,10 +13890,12 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "ast/upsert_clause.h" +#ifndef _IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3024000 #include // std::tuple #include // std::forward, std::move #endif +#endif // #include "../functional/cxx_type_traits_polyfill.h" @@ -13821,19 +13966,23 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "ast/set.h" +#ifndef _IMPORT_STD_MODULE #include // std::tuple, std::tuple_size #include // std::string #include // std::vector #include // std::stringstream #include // std::false_type, std::true_type +#endif // #include "../tuple_helper/tuple_traits.h" // #include "../table_name_collector.h" +#ifndef _IMPORT_STD_MODULE #include // std::set #include // std::string #include // std::pair, std::move +#endif // #include "functional/cxx_type_traits_polyfill.h" @@ -14833,7 +14982,9 @@ auto get_all_optional(Args&&... conditions) { // #include "ast/excluded.h" +#ifndef _IMPORT_STD_MODULE #include // std::move +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { namespace internal { @@ -14862,7 +15013,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "ast/exists.h" +#ifndef _IMPORT_STD_MODULE #include // std::move +#endif // #include "../tags.h" @@ -14898,7 +15051,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "ast/match.h" +#ifndef _IMPORT_STD_MODULE #include +#endif _EXPORT_SQLITE_ORM namespace sqlite_orm { namespace internal { @@ -15686,12 +15841,14 @@ inline constexpr bool std::ranges::enable_borrowed_range +#ifndef _IMPORT_STD_MODULE #include // std::move, std::remove_cvref #include // std::reference_wrapper #if defined(SQLITE_ORM_SENTINEL_BASED_FOR_SUPPORTED) && defined(SQLITE_ORM_DEFAULT_COMPARISONS_SUPPORTED) && \ defined(SQLITE_ORM_CPP20_RANGES_SUPPORTED) #include // std::ranges::view_interface #endif +#endif // #include "functional/cxx_type_traits_polyfill.h" @@ -15700,9 +15857,11 @@ inline constexpr bool std::ranges::enable_borrowed_range +#ifndef _IMPORT_STD_MODULE #include // std::move #include // std::input_iterator_tag, std::default_sentinel_t #include // std::reference_wrapper +#endif // #include "functional/cxx_universal.h" // ::ptrdiff_t @@ -15868,6 +16027,7 @@ inline constexpr bool std::ranges::enable_borrowed_range +#ifndef _IMPORT_STD_MODULE #include // std::allocator #include // std::function, std::bind, std::bind_front #include // std::string @@ -15881,15 +16041,20 @@ inline constexpr bool std::ranges::enable_borrowed_range // std::map #include // std::is_same #include // std::find_if, std::ranges::find +#endif // #include "functional/cxx_universal.h" // ::size_t // #include "functional/cxx_tuple_polyfill.h" +#ifdef _IMPORT_STD_MODULE +#include +#else #include // std::apply; std::tuple_size #if __cpp_lib_apply < 201603L #include // std::forward, std::index_sequence, std::make_index_sequence #endif +#endif // #include "../functional/cxx_universal.h" // ::size_t @@ -15926,12 +16091,14 @@ namespace sqlite_orm { // #include "pragma.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::function #include // std::shared_ptr #include // std::vector #include #include // std::flush +#endif // #include "error_code.h" @@ -15945,12 +16112,14 @@ namespace sqlite_orm { // #include "serializing_util.h" +#ifndef _IMPORT_STD_MODULE #include // std::index_sequence #include #include #include #include #include // std::exchange, std::tuple_size, std::make_index_sequence +#endif // #include "functional/cxx_universal.h" // ::size_t @@ -16612,9 +16781,11 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "limit_accessor.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::map #include // std::function #include // std::shared_ptr +#endif // #include "connection_holder.h" @@ -16751,8 +16922,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "transaction_guard.h" +#ifndef _IMPORT_STD_MODULE #include // std::function #include // std::move +#endif // #include "connection_holder.h" @@ -16837,10 +17010,12 @@ namespace sqlite_orm { // #include "backup.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::system_error #include // std::string #include #include // std::move, std::exchange +#endif // #include "error_code.h" @@ -16914,8 +17089,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "values_to_tuple.h" #include +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::index_sequence, std::make_index_sequence #include // std::tuple, std::tuple_size, std::tuple_element +#endif // #include "functional/cxx_universal.h" // ::size_t @@ -17114,6 +17291,7 @@ namespace sqlite_orm { // #include "udf_proxy.h" #include +#ifndef _IMPORT_STD_MODULE #include // assert macro #include // std::true_type, std::false_type #include // std::bad_alloc @@ -17121,6 +17299,7 @@ namespace sqlite_orm { #include // std::string #include // std::function #include // std::move, std::pair +#endif // #include "error_code.h" @@ -18281,8 +18460,10 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "expression_object_type.h" +#ifndef _IMPORT_STD_MODULE #include // std::decay, std::remove_reference #include // std::reference_wrapper +#endif // #include "type_traits.h" @@ -18398,6 +18579,7 @@ namespace sqlite_orm { // #include "statement_serializer.h" +#ifndef _IMPORT_STD_MODULE #include // std::stringstream #include // std::string #include // std::enable_if, std::remove_pointer @@ -18409,12 +18591,13 @@ namespace sqlite_orm { #include #include #include // std::list +#endif // #include "functional/cxx_string_view.h" // #include "functional/cxx_optional.h" // #include "functional/cxx_universal.h" -// ::nullptr_t, ::size_t +// std::nullptr_t, ::size_t // #include "functional/cxx_functional_polyfill.h" // #include "functional/mpl.h" @@ -18471,12 +18654,14 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "column_names_getter.h" +#ifndef _IMPORT_STD_MODULE #include // std::is_base_of #include // std::string #include // std::vector #include // std::reference_wrapper #include #include // std::move +#endif // #include "tuple_helper/tuple_traits.h" @@ -18611,12 +18796,14 @@ namespace sqlite_orm { // #include "cte_column_names_collector.h" +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #include #include // std::reference_wrapper #include #endif +#endif // #include "functional/cxx_universal.h" @@ -18829,8 +19016,10 @@ namespace sqlite_orm { // #include "order_by_serializer.h" +#ifndef _IMPORT_STD_MODULE #include // std::string #include // std::stringstream +#endif namespace sqlite_orm { @@ -18922,10 +19111,12 @@ namespace sqlite_orm { // #include "schema/triggers.h" +#ifndef _IMPORT_STD_MODULE #include #include #include #include +#endif // #include "../functional/cxx_universal.h" @@ -19302,7 +19493,7 @@ namespace sqlite_orm { template std::string do_serialize(const pointer_binding&) const { // always serialize null (security reasons) - return field_printer{}(nullptr); + return field_printer{}(nullptr); } #endif }; @@ -21491,12 +21682,14 @@ namespace sqlite_orm { // #include "cte_storage.h" +#ifndef _IMPORT_STD_MODULE #if(SQLITE_VERSION_NUMBER >= 3008003) && defined(SQLITE_ORM_WITH_CTE) #include #include #include #include #endif +#endif // #include "functional/cxx_universal.h" // ::size_t @@ -21518,9 +21711,11 @@ namespace sqlite_orm { // #include "column_expression.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic #include // std::tuple #include // std::reference_wrapper +#endif // #include "functional/cxx_type_traits_polyfill.h" @@ -23604,7 +23799,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { * this file is also used to provide definitions of interface methods 'hitting the database'. */ +#ifndef _IMPORT_STD_MODULE #include // std::make_unique +#endif // #include "../functional/static_magic.h" @@ -23612,7 +23809,9 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "../default_value_extractor.h" +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif // #include "constraints.h" @@ -23669,9 +23868,11 @@ namespace sqlite_orm { * this file is also used to provide definitions of interface methods 'hitting the database'. */ +#ifndef _IMPORT_STD_MODULE #include // std::decay_t #include // std::move #include // std::find_if, std::ranges::find +#endif // #include "../functional/cxx_universal.h" // ::size_t @@ -23728,17 +23929,21 @@ namespace sqlite_orm { * e.g. usage of the dbstat table. */ +#ifndef _IMPORT_STD_MODULE #include // std::is_same #include // std::stringstream #include // std::flush #include // std::reference_wrapper, std::cref #include // std::find_if, std::ranges::find +#endif // #include "../type_traits.h" // #include "../sqlite_schema_table.h" +#ifndef _IMPORT_STD_MODULE #include // std::string +#endif // #include "schema/column.h" @@ -23787,9 +23992,11 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { // #include "../eponymous_vtabs/dbstat.h" +#ifndef _IMPORT_STD_MODULE #ifdef SQLITE_ENABLE_DBSTAT_VTAB #include // std::string #endif +#endif // #include "../schema/column.h" @@ -23968,8 +24175,10 @@ namespace sqlite_orm { #pragma once +#ifndef _IMPORT_STD_MODULE #include // std::is_same, std::remove_reference, std::remove_cvref #include // std::get +#endif // #include "functional/cxx_universal.h" // ::size_t @@ -23985,12 +24194,15 @@ namespace sqlite_orm { // #include "node_tuple.h" +#ifndef _IMPORT_STD_MODULE #include // std::enable_if #include // std::tuple #include // std::pair #include // std::reference_wrapper // #include "functional/cxx_optional.h" +#endif + // #include "functional/cxx_type_traits_polyfill.h" // #include "tuple_helper/tuple_filter.h" @@ -24424,6 +24636,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { * Hence we make it only available for compilers supporting inline variables. */ +#ifndef _IMPORT_STD_MODULE #if SQLITE_VERSION_NUMBER >= 3020000 #ifdef SQLITE_ORM_INLINE_VARIABLES_SUPPORTED #include // std::move @@ -24432,6 +24645,7 @@ _EXPORT_SQLITE_ORM namespace sqlite_orm { #endif #endif #endif +#endif // #include "pointer_value.h" diff --git a/modules/sqlite_orm.ixx b/modules/sqlite_orm.ixx index f40e3bc1a..6e5ef4017 100644 --- a/modules/sqlite_orm.ixx +++ b/modules/sqlite_orm.ixx @@ -2,9 +2,19 @@ module; #define _BUILD_SQLITE_ORM_MODULE +#define _IMPORT_STD_MODULE + +#ifdef _IMPORT_STD_MODULE +// Including assert.h when using `import std;` below doesn't work, so we include it here +#include // assert macro +#endif export module sqlite_orm; +#ifdef _IMPORT_STD_MODULE +import std; +#endif + #pragma warning(push) #pragma warning(disable : 5244) // '#include ' in the purview of module 'sqlite_orm' appears erroneous.