skypjack 1 неделя назад
Родитель
Сommit
e0f4c37639

+ 1 - 0
CMakeLists.txt

@@ -200,6 +200,7 @@ if(ENTT_INCLUDE_HEADERS)
         stl/array.hpp
         stl/atomic.hpp
         stl/bit.hpp
+        stl/compare.hpp
         stl/concepts.hpp
         stl/cstddef.hpp
         stl/cstdint.hpp

+ 1 - 1
src/entt/container/dense_map.hpp

@@ -1,7 +1,6 @@
 #ifndef ENTT_CONTAINER_DENSE_MAP_HPP
 #define ENTT_CONTAINER_DENSE_MAP_HPP
 
-#include <compare>
 #include "../config/config.h"
 #include "../core/bit.hpp"
 #include "../core/compressed_pair.hpp"
@@ -9,6 +8,7 @@
 #include "../core/memory.hpp"
 #include "../core/type_traits.hpp"
 #include "../stl/bit.hpp"
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/cstddef.hpp"
 #include "../stl/functional.hpp"

+ 1 - 1
src/entt/container/dense_set.hpp

@@ -1,12 +1,12 @@
 #ifndef ENTT_CONTAINER_DENSE_SET_HPP
 #define ENTT_CONTAINER_DENSE_SET_HPP
 
-#include <compare>
 #include "../config/config.h"
 #include "../core/bit.hpp"
 #include "../core/compressed_pair.hpp"
 #include "../core/type_traits.hpp"
 #include "../stl/bit.hpp"
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/cstddef.hpp"
 #include "../stl/functional.hpp"

+ 1 - 1
src/entt/core/type_info.hpp

@@ -1,8 +1,8 @@
 #ifndef ENTT_CORE_TYPE_INFO_HPP
 #define ENTT_CORE_TYPE_INFO_HPP
 
-#include <compare>
 #include "../config/config.h"
+#include "../stl/compare.hpp"
 #include "../stl/string_view.hpp"
 #include "../stl/type_traits.hpp"
 #include "../stl/utility.hpp"

+ 1 - 1
src/entt/entity/registry.hpp

@@ -1,7 +1,6 @@
 #ifndef ENTT_ENTITY_REGISTRY_HPP
 #define ENTT_ENTITY_REGISTRY_HPP
 
-#include <compare>
 #include "../config/config.h"
 #include "../container/dense_map.hpp"
 #include "../core/algorithm.hpp"
@@ -14,6 +13,7 @@
 #include "../core/type_traits.hpp"
 #include "../stl/algorithm.hpp"
 #include "../stl/array.hpp"
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/cstddef.hpp"
 #include "../stl/functional.hpp"

+ 1 - 1
src/entt/entity/sparse_set.hpp

@@ -1,12 +1,12 @@
 #ifndef ENTT_ENTITY_SPARSE_SET_HPP
 #define ENTT_ENTITY_SPARSE_SET_HPP
 
-#include <compare>
 #include "../config/config.h"
 #include "../core/algorithm.hpp"
 #include "../core/any.hpp"
 #include "../core/bit.hpp"
 #include "../core/type_info.hpp"
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/cstddef.hpp"
 #include "../stl/iterator.hpp"

+ 1 - 1
src/entt/entity/storage.hpp

@@ -1,12 +1,12 @@
 #ifndef ENTT_ENTITY_STORAGE_HPP
 #define ENTT_ENTITY_STORAGE_HPP
 
-#include <compare>
 #include "../config/config.h"
 #include "../core/bit.hpp"
 #include "../core/iterator.hpp"
 #include "../core/memory.hpp"
 #include "../core/type_info.hpp"
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/cstddef.hpp"
 #include "../stl/iterator.hpp"

+ 1 - 1
src/entt/meta/range.hpp

@@ -1,9 +1,9 @@
 #ifndef ENTT_META_RANGE_HPP
 #define ENTT_META_RANGE_HPP
 
-#include <compare>
 #include "../core/fwd.hpp"
 #include "../core/iterator.hpp"
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/cstddef.hpp"
 #include "../stl/iterator.hpp"

+ 1 - 1
src/entt/resource/cache.hpp

@@ -1,11 +1,11 @@
 #ifndef ENTT_RESOURCE_RESOURCE_CACHE_HPP
 #define ENTT_RESOURCE_RESOURCE_CACHE_HPP
 
-#include <compare>
 #include "../container/dense_map.hpp"
 #include "../core/compressed_pair.hpp"
 #include "../core/fwd.hpp"
 #include "../core/iterator.hpp"
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/cstddef.hpp"
 #include "../stl/functional.hpp"

+ 1 - 1
src/entt/resource/resource.hpp

@@ -1,7 +1,7 @@
 #ifndef ENTT_RESOURCE_RESOURCE_HPP
 #define ENTT_RESOURCE_RESOURCE_HPP
 
-#include <compare>
+#include "../stl/compare.hpp"
 #include "../stl/concepts.hpp"
 #include "../stl/memory.hpp"
 #include "../stl/utility.hpp"

+ 15 - 0
src/entt/stl/compare.hpp

@@ -0,0 +1,15 @@
+#ifndef ENTT_STL_COMPARE_HPP
+#define ENTT_STL_COMPARE_HPP
+
+/*! @cond ENTT_INTERNAL */
+#if __has_include(<entt/ext/stl/compare.hpp>)
+#    include <entt/ext/stl/compare.hpp>
+#else
+#    include <compare>
+
+namespace entt::stl {
+} // namespace entt::stl
+#endif
+/*! @endcond */
+
+#endif

+ 1 - 0
test/CMakeLists.txt

@@ -397,6 +397,7 @@ SETUP_BASIC_TEST(
         entt/stl_ext/array.cpp
         entt/stl_ext/atomic.cpp
         entt/stl_ext/bit.cpp
+        entt/stl_ext/compare.cpp
         entt/stl_ext/concepts.cpp
         entt/stl_ext/cstddef.cpp
         entt/stl_ext/cstdint.cpp

+ 6 - 0
test/entt/stl_ext/compare.cpp

@@ -0,0 +1,6 @@
+#include <gtest/gtest.h>
+#include <entt/stl/compare.hpp>
+
+TEST(Compare, HasInclude) {
+    static_assert(entt::stl::entt_ext_compare, "Header not properly included");
+}

+ 13 - 0
test/include/entt/ext/stl/compare.hpp

@@ -0,0 +1,13 @@
+#ifndef ENTT_EXT_STL_COMPARE_HPP
+#define ENTT_EXT_STL_COMPARE_HPP
+
+/*! @cond ENTT_INTERNAL */
+#include <compare>
+
+namespace entt::stl {
+using namespace std;
+inline constexpr auto entt_ext_compare = true;
+} // namespace entt::stl
+/*! @endcond */
+
+#endif