stl: std::unique_ptr

This commit is contained in:
skypjack
2026-04-15 09:21:56 +02:00
parent 6b7513eb1a
commit ddeea943f2
5 changed files with 8 additions and 7 deletions

View File

@@ -82,7 +82,7 @@ struct allocation_deleter: private Allocator {
};
/**
* @brief Allows `std::unique_ptr` to use allocators (waiting for C++20).
* @brief Allows `stl::unique_ptr` to use allocators (waiting for C++20).
* @tparam Type Type of object to allocate for and to construct.
* @tparam Allocator Type of allocator used to manage memory and elements.
* @tparam Args Types of arguments to use to construct the object.
@@ -108,7 +108,7 @@ constexpr auto allocate_unique(Allocator &allocator, Args &&...args) {
ENTT_THROW;
}
return std::unique_ptr<Type, allocation_deleter<allocator_type>>{ptr, alloc};
return stl::unique_ptr<Type, allocation_deleter<allocator_type>>{ptr, alloc};
}
/*! @cond ENTT_INTERNAL */

View File

@@ -15,7 +15,7 @@ namespace internal {
struct meta_type_node;
struct meta_context {
using container_type = dense_map<id_type, std::unique_ptr<meta_type_node>, stl::identity>;
using container_type = dense_map<id_type, stl::unique_ptr<meta_type_node>, stl::identity>;
container_type bucket;

View File

@@ -111,7 +111,7 @@ struct meta_func_node {
const meta_type_node &(*ret)(const meta_context &) noexcept {};
meta_type (*arg)(const meta_ctx &, const size_type) noexcept {};
meta_any (*invoke)(meta_handle, meta_any *const){};
std::unique_ptr<meta_func_node> next;
stl::unique_ptr<meta_func_node> next;
meta_custom_node custom{};
};
@@ -145,7 +145,7 @@ struct meta_type_node {
meta_any (*from_void)(const meta_ctx &, void *, const void *){};
meta_template_node templ{};
meta_custom_node custom{};
std::unique_ptr<meta_type_descriptor> details{};
stl::unique_ptr<meta_type_descriptor> details{};
};
template<typename Type, typename Value>

View File

@@ -19,13 +19,13 @@ struct is_meta_pointer_like<std::shared_ptr<Type>>
: stl::true_type {};
/**
* @brief Makes `std::unique_ptr`s of any type pointer-like types for the meta
* @brief Makes `stl::unique_ptr`s of any type pointer-like types for the meta
* system.
* @tparam Type Element type.
* @tparam Args Other arguments.
*/
template<typename Type, typename... Args>
struct is_meta_pointer_like<std::unique_ptr<Type, Args...>>
struct is_meta_pointer_like<stl::unique_ptr<Type, Args...>>
: stl::true_type {};
/**

View File

@@ -10,6 +10,7 @@ namespace entt::stl {
using std::make_unique;
using std::pointer_traits;
using std::unique_ptr;
} // namespace entt::stl