Browse Source

stl: cleanup

skypjack 1 tuần trước cách đây
mục cha
commit
74947434d7
3 tập tin đã thay đổi với 11 bổ sung11 xóa
  1. 2 2
      src/entt/stl/functional.hpp
  2. 4 4
      src/entt/stl/iterator.hpp
  3. 5 5
      src/entt/stl/memory.hpp

+ 2 - 2
src/entt/stl/functional.hpp

@@ -2,8 +2,8 @@
 #define ENTT_STL_FUNCTIONAL_HPP
 
 #include <functional>
+#include <version>
 #include "../config/config.h"
-#include "version.hpp"
 
 /*! @cond ENTT_INTERNAL */
 namespace entt::stl {
@@ -30,7 +30,7 @@ using std::identity;
 #endif
 
 #ifndef ENTT_HAS_IDENTITY
-#    include "utility.hpp"
+#    include <utility>
 
 namespace entt::stl {
 

+ 4 - 4
src/entt/stl/iterator.hpp

@@ -34,8 +34,8 @@ using std::sentinel_for;
 #endif
 
 #ifndef ENTT_HAS_ITERATOR_CONCEPTS
+#    include <concepts>
 #    include <utility>
-#    include "concepts.hpp"
 
 namespace internal {
 
@@ -60,7 +60,7 @@ struct iterator_tag<It> {
 };
 
 template<typename It, typename Tag>
-concept has_iterator_tag = stl::derived_from<typename iterator_tag<It>::type, Tag>;
+concept has_iterator_tag = std::derived_from<typename iterator_tag<It>::type, Tag>;
 
 } // namespace internal
 
@@ -70,7 +70,7 @@ concept has_iterator_tag = stl::derived_from<typename iterator_tag<It>::type, Ta
 template<typename It>
 concept input_or_output_iterator = requires(It it) {
     *it;
-    { ++it } -> stl::same_as<It &>;
+    { ++it } -> std::same_as<It &>;
     it++;
 };
 
@@ -93,7 +93,7 @@ concept random_access_iterator = bidirectional_iterator<It> && internal::has_ite
 
 template<class Sentinel, typename It>
 concept sentinel_for = input_or_output_iterator<It> && requires(Sentinel sentinel, It it) {
-    { it == sentinel } -> stl::same_as<bool>;
+    { it == sentinel } -> std::same_as<bool>;
 };
 
 #endif

+ 5 - 5
src/entt/stl/memory.hpp

@@ -42,22 +42,22 @@ using std::to_address;
 #endif
 
 #ifndef ENTT_HAS_TO_ADDRESS
-#    include "type_traits.hpp"
+#    include <type_traits>
 
 namespace entt::stl {
 
 template<typename Type>
 constexpr Type *to_address(Type *ptr) noexcept {
-    static_assert(!is_function_v<Type>, "Invalid type");
+    static_assert(!std::is_function_v<Type>, "Invalid type");
     return ptr;
 }
 
 template<typename Type>
 constexpr auto to_address(const Type &ptr) noexcept {
-    if constexpr(requires { pointer_traits<Type>::to_address(ptr); }) {
-        return pointer_traits<Type>::to_address(ptr);
+    if constexpr(requires { std::pointer_traits<Type>::to_address(ptr); }) {
+        return std::pointer_traits<Type>::to_address(ptr);
     } else {
-        return to_address(ptr.operator->());
+        return std::to_address(ptr.operator->());
     }
 }