1#ifndef ENTT_STL_MEMORY_HPP
2#define ENTT_STL_MEMORY_HPP
5#if __has_include(<entt/ext/stl/memory.hpp>)
6# include <entt/ext/stl/memory.hpp>
10# include "../config/config.h"
15using std::allocate_shared;
17using std::allocator_arg;
18using std::allocator_arg_t;
19using std::allocator_traits;
20using std::default_delete;
22using std::enable_shared_from_this;
23using std::make_shared;
24using std::make_unique;
25using std::pointer_traits;
27using std::static_pointer_cast;
28using std::uninitialized_fill;
30using std::uses_allocator_v;
34# ifndef ENTT_FORCE_STL
35# if defined(__cpp_lib_to_address)
36# define ENTT_HAS_TO_ADDRESS
47# ifndef ENTT_HAS_TO_ADDRESS
48# include <type_traits>
52template<
typename Type>
53constexpr Type *to_address(Type *ptr)
noexcept {
54 static_assert(!std::is_function_v<Type>,
"Invalid type");
58template<
typename Type>
59constexpr auto to_address(
const Type &ptr)
noexcept {
60 if constexpr(
requires { std::pointer_traits<Type>::to_address(ptr); }) {
61 return std::pointer_traits<Type>::to_address(ptr);
63 return to_address(ptr.operator->());
72#undef ENTT_HAS_TO_ADDRESS
Custom EnTT namespace for the standard template library.