stl: std::shared_ptr
This commit is contained in:
@@ -213,9 +213,9 @@ class basic_registry {
|
||||
using base_type = basic_sparse_set<Entity, Allocator>;
|
||||
using alloc_traits = std::allocator_traits<Allocator>;
|
||||
static_assert(stl::is_same_v<typename alloc_traits::value_type, Entity>, "Invalid value type");
|
||||
// std::shared_ptr because of its type erased allocator which is useful here
|
||||
using pool_container_type = dense_map<id_type, std::shared_ptr<base_type>, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<stl::pair<const id_type, std::shared_ptr<base_type>>>>;
|
||||
using group_container_type = dense_map<id_type, std::shared_ptr<internal::group_descriptor>, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<stl::pair<const id_type, std::shared_ptr<internal::group_descriptor>>>>;
|
||||
// stl::shared_ptr because of its type erased allocator which is useful here
|
||||
using pool_container_type = dense_map<id_type, stl::shared_ptr<base_type>, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<stl::pair<const id_type, stl::shared_ptr<base_type>>>>;
|
||||
using group_container_type = dense_map<id_type, stl::shared_ptr<internal::group_descriptor>, stl::identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<stl::pair<const id_type, stl::shared_ptr<internal::group_descriptor>>>>;
|
||||
using traits_type = entt_traits<Entity>;
|
||||
|
||||
template<cvref_unqualified Type>
|
||||
@@ -1053,7 +1053,7 @@ public:
|
||||
return {*std::static_pointer_cast<handler_type>(it->second)};
|
||||
}
|
||||
|
||||
std::shared_ptr<handler_type> handler{};
|
||||
stl::shared_ptr<handler_type> handler{};
|
||||
|
||||
if constexpr(sizeof...(Owned) == 0u) {
|
||||
handler = std::allocate_shared<handler_type>(get_allocator(), get_allocator(), stl::forward_as_tuple(assure<stl::remove_const_t<Get>>()...), stl::forward_as_tuple(assure<stl::remove_const_t<Exclude>>()...));
|
||||
|
||||
@@ -28,7 +28,7 @@ template<typename Service>
|
||||
class locator final {
|
||||
class service_handle {
|
||||
friend class locator<Service>;
|
||||
std::shared_ptr<Service> value{};
|
||||
stl::shared_ptr<Service> value{};
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -147,13 +147,13 @@ public:
|
||||
*/
|
||||
template<std::derived_from<Service> Type, typename Deleter = std::default_delete<Type>>
|
||||
static void reset(Type *elem, Deleter deleter = {}) {
|
||||
service = std::shared_ptr<Service>{elem, stl::move(deleter)};
|
||||
service = stl::shared_ptr<Service>{elem, stl::move(deleter)};
|
||||
}
|
||||
|
||||
private:
|
||||
// std::shared_ptr because of its type erased allocator which is useful here
|
||||
// stl::shared_ptr because of its type erased allocator which is useful here
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
inline static std::shared_ptr<Service> service{};
|
||||
inline static stl::shared_ptr<Service> service{};
|
||||
};
|
||||
|
||||
} // namespace entt
|
||||
|
||||
@@ -64,7 +64,7 @@ struct meta_type_node;
|
||||
|
||||
struct meta_custom_node {
|
||||
id_type id{};
|
||||
std::shared_ptr<void> value{};
|
||||
stl::shared_ptr<void> value{};
|
||||
};
|
||||
|
||||
struct meta_base_node {
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
namespace entt {
|
||||
|
||||
/**
|
||||
* @brief Makes `std::shared_ptr`s of any type pointer-like types for the meta
|
||||
* @brief Makes `stl::shared_ptr`s of any type pointer-like types for the meta
|
||||
* system.
|
||||
* @tparam Type Element type.
|
||||
*/
|
||||
template<typename Type>
|
||||
struct is_meta_pointer_like<std::shared_ptr<Type>>
|
||||
struct is_meta_pointer_like<stl::shared_ptr<Type>>
|
||||
: stl::true_type {};
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
/*! @brief Type used to provide elapsed time. */
|
||||
using delta_type = Delta;
|
||||
/*! @brief Handle type. */
|
||||
using handle_type = std::shared_ptr<basic_process>;
|
||||
using handle_type = stl::shared_ptr<basic_process>;
|
||||
|
||||
/*! @brief Default constructor. */
|
||||
basic_process()
|
||||
|
||||
@@ -36,8 +36,8 @@ template<typename Delta, typename Allocator>
|
||||
class basic_scheduler {
|
||||
using base_type = basic_process<Delta, Allocator>;
|
||||
using alloc_traits = std::allocator_traits<Allocator>;
|
||||
using container_allocator = alloc_traits::template rebind_alloc<std::shared_ptr<base_type>>;
|
||||
using container_type = stl::vector<std::shared_ptr<base_type>, container_allocator>;
|
||||
using container_allocator = alloc_traits::template rebind_alloc<stl::shared_ptr<base_type>>;
|
||||
using container_type = stl::vector<stl::shared_ptr<base_type>, container_allocator>;
|
||||
|
||||
public:
|
||||
/*! @brief Process type. */
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace entt {
|
||||
template<typename Type>
|
||||
struct resource_loader {
|
||||
/*! @brief Result type. */
|
||||
using result_type = std::shared_ptr<Type>;
|
||||
using result_type = stl::shared_ptr<Type>;
|
||||
|
||||
/**
|
||||
* @brief Constructs a shared pointer to a resource from its arguments.
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
/*! @brief Resource type. */
|
||||
using element_type = Type;
|
||||
/*! @brief Handle type. */
|
||||
using handle_type = std::shared_ptr<element_type>;
|
||||
using handle_type = stl::shared_ptr<element_type>;
|
||||
|
||||
/*! @brief Default constructor. */
|
||||
resource() noexcept
|
||||
|
||||
@@ -108,8 +108,8 @@ class basic_dispatcher {
|
||||
using handler_type = internal::dispatcher_handler<Type, Allocator>;
|
||||
|
||||
using key_type = id_type;
|
||||
// std::shared_ptr because of its type erased allocator which is useful here
|
||||
using mapped_type = std::shared_ptr<internal::basic_dispatcher_handler>;
|
||||
// stl::shared_ptr because of its type erased allocator which is useful here
|
||||
using mapped_type = stl::shared_ptr<internal::basic_dispatcher_handler>;
|
||||
|
||||
using alloc_traits = std::allocator_traits<Allocator>;
|
||||
using container_allocator = alloc_traits::template rebind_alloc<stl::pair<const key_type, mapped_type>>;
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace entt::stl {
|
||||
|
||||
using std::make_unique;
|
||||
using std::pointer_traits;
|
||||
using std::shared_ptr;
|
||||
using std::unique_ptr;
|
||||
|
||||
} // namespace entt::stl
|
||||
|
||||
Reference in New Issue
Block a user