Michele Caini 1 неделя назад
Родитель
Сommit
6cd90b4715
3 измененных файлов с 23 добавлено и 2 удалено
  1. 6 2
      src/entt/stl/tuple.hpp
  2. 4 0
      test/entt/stl_ext/tuple.cpp
  3. 13 0
      test/include/entt/ext/stl/tuple.hpp

+ 6 - 2
src/entt/stl/tuple.hpp

@@ -1,9 +1,12 @@
 #ifndef ENTT_STL_TUPLE_HPP
 #define ENTT_STL_TUPLE_HPP
 
-#include <tuple>
-
 /*! @cond ENTT_INTERNAL */
+#if __has_include(<entt/ext/stl/tuple.hpp>)
+#    include <entt/ext/stl/tuple.hpp>
+#else
+#    include <tuple>
+
 namespace entt::stl {
 
 using std::apply;
@@ -19,6 +22,7 @@ using std::tuple_size;
 using std::tuple_size_v;
 
 } // namespace entt::stl
+#endif
 /*! @endcond */
 
 #endif

+ 4 - 0
test/entt/stl_ext/tuple.cpp

@@ -1,2 +1,6 @@
 #include <gtest/gtest.h>
 #include <entt/stl/tuple.hpp>
+
+TEST(Tuple, HasInclude) {
+    static_assert(entt::stl::entt_ext_tuple, "Header not properly included");
+}

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

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