From 171700153e8a83ee8b5bb439ef485e62958cc21a Mon Sep 17 00:00:00 2001 From: skypjack Date: Thu, 26 Mar 2026 18:31:26 +0100 Subject: [PATCH] stl: internal changes --- src/entt/stl/functional.hpp | 13 ++++++++++--- src/entt/stl/iterator.hpp | 13 ++++++++++--- src/entt/stl/memory.hpp | 15 +++++++++++---- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/entt/stl/functional.hpp b/src/entt/stl/functional.hpp index 1e4ea5171..3fdc6c313 100644 --- a/src/entt/stl/functional.hpp +++ b/src/entt/stl/functional.hpp @@ -4,8 +4,6 @@ #include "../config/config.h" /*! @cond ENTT_INTERNAL */ -namespace entt::stl { - #ifndef ENTT_FORCE_STL # if __has_include() # include @@ -13,7 +11,13 @@ namespace entt::stl { # if defined(__cpp_lib_ranges) # define ENTT_HAS_IDENTITY # include + +namespace entt::stl { + using std::identity; + +} // namespace entt::stl + # endif # endif #endif @@ -21,6 +25,8 @@ using std::identity; #ifndef ENTT_HAS_IDENTITY # include +namespace entt::stl { + struct identity { using is_transparent = void; @@ -29,9 +35,10 @@ struct identity { return std::forward(value); } }; -#endif } // namespace entt::stl + +#endif /*! @endcond */ #endif diff --git a/src/entt/stl/iterator.hpp b/src/entt/stl/iterator.hpp index ac300cd22..b082b9993 100644 --- a/src/entt/stl/iterator.hpp +++ b/src/entt/stl/iterator.hpp @@ -4,8 +4,6 @@ #include "../config/config.h" /*! @cond ENTT_INTERNAL */ -namespace entt::stl { - #ifndef ENTT_FORCE_STL # if __has_include() # include @@ -13,6 +11,9 @@ namespace entt::stl { # if defined(__cpp_lib_ranges) # define ENTT_HAS_ITERATOR_CONCEPTS # include + +namespace entt::stl { + using std::bidirectional_iterator; using std::forward_iterator; using std::input_iterator; @@ -20,6 +21,9 @@ using std::input_or_output_iterator; using std::output_iterator; using std::random_access_iterator; using std::sentinel_for; + +} // namespace entt::stl + # endif # endif #endif @@ -29,6 +33,8 @@ using std::sentinel_for; # include # include +namespace entt::stl { + namespace internal { template @@ -87,9 +93,10 @@ template concept sentinel_for = input_or_output_iterator && requires(Sentinel sentinel, It it) { { it == sentinel } -> std::same_as; }; -#endif } // namespace entt::stl + +#endif /*! @endcond */ #endif diff --git a/src/entt/stl/memory.hpp b/src/entt/stl/memory.hpp index 36a8980f4..eb663d5a9 100644 --- a/src/entt/stl/memory.hpp +++ b/src/entt/stl/memory.hpp @@ -4,8 +4,6 @@ #include "../config/config.h" /*! @cond ENTT_INTERNAL */ -namespace entt::stl { - #ifndef ENTT_FORCE_STL # if __has_include() # include @@ -13,7 +11,13 @@ namespace entt::stl { # if defined(__cpp_lib_to_address) # define ENTT_HAS_TO_ADDRESS # include + +namespace entt::stl { + using std::to_address; + +} // namespace entt::stl + # endif # endif #endif @@ -22,6 +26,8 @@ using std::to_address; # include # include +namespace entt::stl { + template constexpr Type *to_address(Type *ptr) noexcept { static_assert(!std::is_function_v, "Invalid type"); @@ -36,9 +42,10 @@ constexpr auto to_address(const Type &ptr) noexcept { return to_address(ptr.operator->()); } } -#endif -/*! @endcond */ } // namespace entt::stl #endif +/*! @endcond */ + +#endif