stl: cleanup

This commit is contained in:
skypjack
2026-04-29 13:33:16 +02:00
parent 5fa956395a
commit 74947434d7
3 changed files with 11 additions and 11 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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->());
}
}