skypjack 12 часов назад
Родитель
Сommit
62ae11b433
3 измененных файлов с 23 добавлено и 2 удалено
  1. 6 2
      src/entt/stl/string.hpp
  2. 4 0
      test/entt/stl_ext/string.cpp
  3. 13 0
      test/include/entt/ext/stl/string.hpp

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

@@ -1,14 +1,18 @@
 #ifndef ENTT_STL_STRING_HPP
 #define ENTT_STL_STRING_HPP
 
-#include <string>
-
 /*! @cond ENTT_INTERNAL */
+#if __has_include(<entt/ext/stl/string.hpp>)
+#    include <entt/ext/stl/string.hpp>
+#else
+#    include <string>
+
 namespace entt::stl {
 
 using std::string;
 
 } // namespace entt::stl
+#endif
 /*! @endcond */
 
 #endif

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

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

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

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