1#ifndef ENTT_ENTITY_STORAGE_HPP
2#define ENTT_ENTITY_STORAGE_HPP
11#include "../config/config.h"
12#include "../core/iterator.hpp"
13#include "../core/memory.hpp"
14#include "../core/type_info.hpp"
15#include "component.hpp"
18#include "sparse_set.hpp"
25template<
typename Container, std::
size_t Size>
26class storage_iterator final {
27 friend storage_iterator<const Container, Size>;
29 using container_type = std::remove_const_t<Container>;
30 using alloc_traits = std::allocator_traits<typename container_type::allocator_type>;
32 using iterator_traits = std::iterator_traits<std::conditional_t<
33 std::is_const_v<Container>,
34 typename alloc_traits::template rebind_traits<typename std::pointer_traits<typename container_type::value_type>::element_type>::const_pointer,
35 typename alloc_traits::template rebind_traits<typename std::pointer_traits<typename container_type::value_type>::element_type>::pointer>>;
38 using value_type =
typename iterator_traits::value_type;
39 using pointer =
typename iterator_traits::pointer;
40 using reference =
typename iterator_traits::reference;
41 using difference_type =
typename iterator_traits::difference_type;
42 using iterator_category = std::random_access_iterator_tag;
44 constexpr storage_iterator() noexcept = default;
46 constexpr storage_iterator(Container *ref, const difference_type idx) noexcept
50 template<
bool Const = std::is_const_v<Container>,
typename = std::enable_if_t<Const>>
51 constexpr storage_iterator(
const storage_iterator<std::remove_const_t<Container>, Size> &other) noexcept
52 : storage_iterator{other.payload, other.offset} {}
54 constexpr storage_iterator &operator++() noexcept {
55 return --offset, *
this;
58 constexpr storage_iterator operator++(
int)
noexcept {
59 storage_iterator orig = *
this;
60 return ++(*this), orig;
63 constexpr storage_iterator &operator--() noexcept {
64 return ++offset, *
this;
67 constexpr storage_iterator operator--(
int)
noexcept {
68 storage_iterator orig = *
this;
69 return operator--(), orig;
72 constexpr storage_iterator &operator+=(
const difference_type value)
noexcept {
77 constexpr storage_iterator
operator+(
const difference_type value)
const noexcept {
78 storage_iterator copy = *
this;
79 return (copy += value);
82 constexpr storage_iterator &operator-=(
const difference_type value)
noexcept {
83 return (*
this += -value);
86 constexpr storage_iterator operator-(
const difference_type value)
const noexcept {
87 return (*
this + -value);
90 [[nodiscard]]
constexpr reference operator[](
const difference_type value)
const noexcept {
91 const auto pos = index() - value;
92 return (*payload)[pos / Size][
fast_mod(pos, Size)];
95 [[nodiscard]]
constexpr pointer operator->() const noexcept {
96 const auto pos = index();
97 return (*payload)[pos / Size] +
fast_mod(pos, Size);
100 [[nodiscard]]
constexpr reference operator*() const noexcept {
101 return *operator->();
104 [[nodiscard]]
constexpr difference_type index() const noexcept {
110 difference_type offset;
113template<
typename Lhs,
typename Rhs, std::
size_t Size>
114[[nodiscard]]
constexpr std::ptrdiff_t operator-(
const storage_iterator<Lhs, Size> &lhs,
const storage_iterator<Rhs, Size> &rhs)
noexcept {
115 return rhs.index() - lhs.index();
118template<
typename Lhs,
typename Rhs, std::
size_t Size>
119[[nodiscard]]
constexpr bool operator==(
const storage_iterator<Lhs, Size> &lhs,
const storage_iterator<Rhs, Size> &rhs)
noexcept {
120 return lhs.index() == rhs.index();
123template<
typename Lhs,
typename Rhs, std::
size_t Size>
124[[nodiscard]]
constexpr bool operator!=(
const storage_iterator<Lhs, Size> &lhs,
const storage_iterator<Rhs, Size> &rhs)
noexcept {
125 return !(lhs == rhs);
128template<
typename Lhs,
typename Rhs, std::
size_t Size>
129[[nodiscard]]
constexpr bool operator<(
const storage_iterator<Lhs, Size> &lhs,
const storage_iterator<Rhs, Size> &rhs)
noexcept {
130 return lhs.index() > rhs.index();
133template<
typename Lhs,
typename Rhs, std::
size_t Size>
134[[nodiscard]]
constexpr bool operator>(
const storage_iterator<Lhs, Size> &lhs,
const storage_iterator<Rhs, Size> &rhs)
noexcept {
138template<
typename Lhs,
typename Rhs, std::
size_t Size>
139[[nodiscard]]
constexpr bool operator<=(
const storage_iterator<Lhs, Size> &lhs,
const storage_iterator<Rhs, Size> &rhs)
noexcept {
143template<
typename Lhs,
typename Rhs, std::
size_t Size>
144[[nodiscard]]
constexpr bool operator>=(
const storage_iterator<Lhs, Size> &lhs,
const storage_iterator<Rhs, Size> &rhs)
noexcept {
148template<
typename It,
typename... Other>
149class extended_storage_iterator final {
150 template<
typename Iter,
typename... Args>
151 friend class extended_storage_iterator;
154 using iterator_type = It;
155 using difference_type = std::ptrdiff_t;
156 using value_type =
decltype(std::tuple_cat(std::make_tuple(*std::declval<It>()), std::forward_as_tuple(*std::declval<Other>()...)));
157 using pointer = input_iterator_pointer<value_type>;
158 using reference = value_type;
159 using iterator_category = std::input_iterator_tag;
160 using iterator_concept = std::forward_iterator_tag;
162 constexpr extended_storage_iterator()
165 constexpr extended_storage_iterator(iterator_type base, Other... other)
166 : it{base, other...} {}
168 template<
typename... Args,
typename = std::enable_if_t<(!std::is_same_v<Other, Args> && ...) && (std::is_constructible_v<Other, Args> && ...)>>
169 constexpr extended_storage_iterator(
const extended_storage_iterator<It, Args...> &other)
172 constexpr extended_storage_iterator &operator++() noexcept {
173 return ++std::get<It>(it), (++std::get<Other>(it), ...), *
this;
176 constexpr extended_storage_iterator operator++(
int)
noexcept {
177 extended_storage_iterator orig = *
this;
178 return ++(*this), orig;
181 [[nodiscard]]
constexpr pointer operator->() const noexcept {
185 [[nodiscard]]
constexpr reference operator*() const noexcept {
186 return {*std::get<It>(it), *std::get<Other>(it)...};
189 [[nodiscard]]
constexpr iterator_type base() const noexcept {
190 return std::get<It>(it);
193 template<
typename... Lhs,
typename... Rhs>
194 friend constexpr bool operator==(
const extended_storage_iterator<Lhs...> &,
const extended_storage_iterator<Rhs...> &)
noexcept;
197 std::tuple<It, Other...> it;
200template<
typename... Lhs,
typename... Rhs>
201[[nodiscard]]
constexpr bool operator==(
const extended_storage_iterator<Lhs...> &lhs,
const extended_storage_iterator<Rhs...> &rhs)
noexcept {
202 return std::get<0>(lhs.it) == std::get<0>(rhs.it);
205template<
typename... Lhs,
typename... Rhs>
206[[nodiscard]]
constexpr bool operator!=(
const extended_storage_iterator<Lhs...> &lhs,
const extended_storage_iterator<Rhs...> &rhs)
noexcept {
207 return !(lhs == rhs);
228template<
typename Type,
typename Entity,
typename Allocator,
typename>
230 using alloc_traits = std::allocator_traits<Allocator>;
231 static_assert(std::is_same_v<typename alloc_traits::value_type, Type>,
"Invalid value type");
232 using container_type = std::vector<typename alloc_traits::pointer, typename alloc_traits::template rebind_alloc<typename alloc_traits::pointer>>;
236 [[nodiscard]]
auto &element_at(
const std::size_t pos)
const {
240 auto assure_at_least(
const std::size_t pos) {
243 if(!(idx < payload.size())) {
244 auto curr = payload.size();
246 payload.resize(idx + 1u,
nullptr);
249 for(
const auto last = payload.size(); curr < last; ++curr) {
254 payload.resize(curr);
262 template<
typename... Args>
263 auto emplace_element(
const Entity
entt,
const bool force_back, Args &&...args) {
267 auto elem = assure_at_least(
static_cast<size_type>(it.index()));
278 void shrink_to_size(
const std::size_t sz) {
285 alloc_traits::destroy(allocator, std::addressof(element_at(pos)));
288 alloc_traits::destroy(allocator, std::addressof(element_at(pos)));
292 for(
auto pos = from, last = payload.size(); pos < last; ++pos) {
296 payload.resize(from);
300 const void *get_at(
const std::size_t pos)
const final {
301 return std::addressof(element_at(pos));
304 void swap_or_move([[maybe_unused]]
const std::size_t from, [[maybe_unused]]
const std::size_t to)
override {
305 static constexpr bool is_pinned_type_v = !(std::is_move_constructible_v<Type> && std::is_move_assignable_v<Type>);
307 ENTT_ASSERT((from + 1u) && !is_pinned_type_v,
"Pinned type");
309 if constexpr(!is_pinned_type_v) {
310 auto &elem = element_at(from);
313 if(base_type::operator[](to) ==
tombstone) {
316 alloc_traits::destroy(allocator, std::addressof(elem));
322 swap(elem, element_at(to));
332 void pop(underlying_iterator first, underlying_iterator last)
override {
339 alloc_traits::destroy(allocator, std::addressof(elem));
343 [[maybe_unused]]
auto unused = std::exchange(elem, std::move(other));
344 alloc_traits::destroy(allocator, std::addressof(other));
358 alloc_traits::destroy(allocator, std::addressof(element_at(
static_cast<size_type>(first.index()))));
362 alloc_traits::destroy(allocator, std::addressof(element_at(
static_cast<size_type>(first.index()))));
374 underlying_iterator
try_emplace([[maybe_unused]]
const Entity
entt, [[maybe_unused]]
const bool force_back,
const void *
value)
override {
376 if constexpr(std::is_copy_constructible_v<value_type>) {
382 if constexpr(std::is_default_constructible_v<value_type>) {
383 return emplace_element(
entt, force_back);
404 using pointer =
typename container_type::pointer;
406 using const_pointer =
typename alloc_traits::template rebind_traits<typename alloc_traits::const_pointer>::const_pointer;
408 using iterator = internal::storage_iterator<container_type, traits_type::page_size>;
410 using const_iterator = internal::storage_iterator<const container_type, traits_type::page_size>;
434 payload{allocator} {}
442 payload{std::move(other.payload)} {}
450 :
base_type{std::move(other), allocator},
451 payload{std::move(other.payload), allocator} {
452 ENTT_ASSERT(alloc_traits::is_always_equal::value || payload.get_allocator() == other.payload.get_allocator(),
"Copying a storage is not allowed");
466 ENTT_ASSERT(alloc_traits::is_always_equal::value || payload.get_allocator() == other.payload.get_allocator(),
"Copying a storage is not allowed");
470 payload = std::move(other.payload);
481 swap(payload, other.payload);
489 return payload.get_allocator();
503 assure_at_least(cap - 1u);
527 return payload.data();
532 return payload.data();
543 const auto pos =
static_cast<typename iterator::difference_type
>(
base_type::size());
554 const auto pos =
static_cast<typename iterator::difference_type
>(
base_type::size());
585 return std::make_reverse_iterator(
cend());
595 return std::make_reverse_iterator(
end());
604 return std::make_reverse_iterator(
cbegin());
614 return std::make_reverse_iterator(
begin());
642 return std::forward_as_tuple(
get(
entt));
647 return std::forward_as_tuple(
get(
entt));
662 template<
typename... Args>
664 if constexpr(std::is_aggregate_v<value_type> && (
sizeof...(Args) != 0u || !std::is_default_constructible_v<value_type>)) {
665 const auto it = emplace_element(
entt,
false, Type{std::forward<Args>(args)...});
666 return element_at(
static_cast<size_type>(it.index()));
668 const auto it = emplace_element(
entt,
false, std::forward<Args>(args)...);
669 return element_at(
static_cast<size_type>(it.index()));
680 template<
typename... Func>
683 auto &elem = element_at(idx);
684 (std::forward<Func>(func)(elem), ...);
702 template<
typename It>
704 for(; first != last; ++first) {
705 emplace_element(*first,
true,
value);
724 template<typename EIt, typename CIt, typename = std::enable_if_t<std::is_same_v<typename std::iterator_traits<CIt>::value_type,
value_type>>>
726 for(; first != last; ++first, ++from) {
727 emplace_element(*first,
true, *from);
767 container_type payload;
771template<
typename Type,
typename Entity,
typename Allocator>
772class basic_storage<Type, Entity, Allocator, std::enable_if_t<component_traits<Type>::page_size == 0u>>
773 :
public basic_sparse_set<Entity, typename std::allocator_traits<Allocator>::template rebind_alloc<Entity>> {
774 using alloc_traits = std::allocator_traits<Allocator>;
775 static_assert(std::is_same_v<typename alloc_traits::value_type, Type>,
"Invalid value type");
822 :
base_type{std::move(other), allocator} {}
837 if constexpr(std::is_void_v<value_type> && !std::is_constructible_v<allocator_type, typename base_type::allocator_type>) {
882 template<
typename... Args>
893 template<
typename... Func>
896 (std::forward<Func>(func)(), ...);
906 template<
typename It,
typename... Args>
907 void insert(It first, It last, Args &&...) {
908 for(; first != last; ++first) {
951template<
typename Entity,
typename Allocator>
954 using alloc_traits = std::allocator_traits<Allocator>;
955 static_assert(std::is_same_v<typename alloc_traits::value_type, Entity>,
"Invalid value type");
959 auto entity_at(
const std::size_t pos)
const noexcept {
960 ENTT_ASSERT(pos < underlying_type::traits_type::to_entity(
null),
"Invalid element");
970 underlying_iterator
try_emplace(
const Entity hint,
const bool,
const void *)
override {
1019 :
base_type{std::move(other), allocator} {}
1056 return std::tuple{};
1081 }
else if(
const auto curr = underlying_type::traits_type::construct(underlying_type::traits_type::to_entity(hint),
base_type::current(hint)); curr ==
tombstone) {
1082 const auto pos =
static_cast<size_type>(underlying_type::traits_type::to_entity(hint));
1103 template<
typename... Func>
1106 (std::forward<Func>(func)(), ...);
1115 template<
typename It>
1121 for(; first != last; ++first) {
1133 template<
typename It>
1136 return static_cast<size_type>(std::distance(first, last));
1143 [[deprecated(
"use free_list() instead")]] [[nodiscard]]
size_type in_use() const noexcept {
Basic sparse set implementation.
void swap(basic_sparse_set &other)
Exchanges the contents with those of a given sparse set.
iterator begin() const noexcept
Returns an iterator to the beginning.
const_iterator cbegin() const noexcept
Returns an iterator to the beginning.
virtual basic_iterator try_emplace(const Entity entt, const bool force_back, const void *=nullptr)
Assigns an entity to a sparse set.
void swap_and_pop(const basic_iterator it)
Erases an entity from a sparse set.
iterator end() const noexcept
Returns an iterator to the end.
reverse_iterator rend() const noexcept
Returns a reverse iterator to the end.
pointer data() const noexcept
Direct access to the internal packed array.
basic_sparse_set & operator=(basic_sparse_set &&other) noexcept
Move assignment operator.
virtual void reserve(const size_type cap)
Increases the capacity of a sparse set.
size_type size() const noexcept
Returns the number of elements in a sparse set.
virtual void shrink_to_fit()
Requests the removal of unused capacity.
const_iterator find(const entity_type entt) const noexcept
Finds an entity.
virtual void pop(basic_iterator first, basic_iterator last)
Erases entities from a sparse set.
version_type current(const entity_type entt) const noexcept
Returns the contained version for an identifier.
bool contains(const entity_type entt) const noexcept
Checks if a sparse set contains an entity.
const_iterator cend() const noexcept
Returns an iterator to the end.
void in_place_pop(const basic_iterator it)
Erases an entity from a sparse set.
const_reverse_iterator crend() const noexcept
Returns a reverse iterator to the end.
constexpr allocator_type get_allocator() const noexcept
Returns the associated allocator.
const void * value(const entity_type entt) const noexcept
Returns the element assigned to an entity, if any.
reverse_iterator rbegin() const noexcept
Returns a reverse iterator to the beginning.
size_type free_list() const noexcept
Returns the head of the free list, if any.
internal::sparse_set_iterator< packed_container_type > basic_iterator
Random access iterator type.
const_reverse_iterator crbegin() const noexcept
Returns a reverse iterator to the beginning.
size_type index(const entity_type entt) const noexcept
Returns the position of an entity in a sparse set.
void sort_as(It first, It last)
Sort entities according to their order in a range.
typename traits_type::value_type entity_type
Underlying entity identifier.
const_reverse_iterable reach() const noexcept
Returns a reverse iterable object to use to visit a storage.
std::size_t size_type
Unsigned integer type.
Entity value_type
Type of the objects assigned to entities.
void get(const entity_type entt) const noexcept
Returns the object assigned to an entity, that is void.
void insert(It first, It last)
Assigns each element in a range an identifier.
Entity entity_type
Underlying entity identifier.
basic_storage(basic_storage &&other, const allocator_type &allocator) noexcept
Allocator-extended move constructor.
entity_type emplace(const entity_type hint)
Creates a new identifier or recycles a destroyed one.
underlying_iterator try_emplace(const Entity hint, const bool, const void *) override
Assigns an entity to a storage.
basic_storage & operator=(basic_storage &&other) noexcept
Move assignment operator.
reverse_iterable reach() noexcept
Returns a reverse iterable object to use to visit a storage.
const_iterable each() const noexcept
Returns an iterable object to use to visit a storage.
basic_storage(const allocator_type &allocator)
Constructs an empty container with a given allocator.
Allocator allocator_type
Allocator type.
void in_use(const size_type len) noexcept
Sets the number of elements considered still in use.
basic_storage(basic_storage &&other) noexcept
Move constructor.
entity_type emplace()
Creates a new identifier or recycles a destroyed one.
iterable each() noexcept
Returns an iterable object to use to visit a storage.
size_type pack(It first, It last)
Makes all elements in a range contiguous.
void patch(const entity_type entt, Func &&...func)
Updates a given identifier.
basic_storage()
Default constructor.
size_type in_use() const noexcept
Returns the number of elements considered still in use.
std::tuple get_as_tuple(const entity_type entt) const noexcept
Returns an empty tuple.
basic_storage()
Default constructor.
void emplace(const entity_type entt, Args &&...)
Assigns an entity to a storage and constructs its object.
reverse_iterable reach() noexcept
Returns a reverse iterable object to use to visit a storage.
Type value_type
Type of the objects assigned to entities.
constexpr allocator_type get_allocator() const noexcept
Returns the associated allocator.
void get(const entity_type entt) const noexcept
Returns the object assigned to an entity, that is void.
basic_storage(basic_storage &&other) noexcept=default
Move constructor.
std::size_t size_type
Unsigned integer type.
basic_storage(const allocator_type &allocator)
Constructs an empty container with a given allocator.
Entity entity_type
Underlying entity identifier.
const_iterable each() const noexcept
Returns an iterable object to use to visit a storage.
Allocator allocator_type
Allocator type.
void patch(const entity_type entt, Func &&...func)
Updates the instance assigned to a given entity in-place.
basic_storage(basic_storage &&other, const allocator_type &allocator) noexcept
Allocator-extended move constructor.
std::tuple get_as_tuple(const entity_type entt) const noexcept
Returns an empty tuple.
iterable each() noexcept
Returns an iterable object to use to visit a storage.
basic_storage & operator=(basic_storage &&other) noexcept=default
Move assignment operator.
void insert(It first, It last, Args &&...)
Assigns entities to a storage.
const_reverse_iterable reach() const noexcept
Returns a reverse iterable object to use to visit a storage.
Basic storage implementation.
iterator end() noexcept
Returns an iterator to the end.
~basic_storage() override
Default destructor.
basic_storage()
Default constructor.
iterator insert(EIt first, EIt last, CIt from)
Assigns one or more entities to a storage and constructs their objects from a given range.
const_reverse_iterator rbegin() const noexcept
Returns a reverse iterator to the beginning.
const_iterator end() const noexcept
Returns an iterator to the end.
const_pointer raw() const noexcept
Direct access to the array of objects.
void pop_all() override
Erases all entities of a storage.
basic_storage(basic_storage &&other) noexcept
Move constructor.
const value_type & get(const entity_type entt) const noexcept
Returns the object assigned to an entity.
const_iterator cend() const noexcept
Returns an iterator to the end.
size_type capacity() const noexcept override
Returns the number of elements that a storage has currently allocated space for.
constexpr allocator_type get_allocator() const noexcept
Returns the associated allocator.
typename alloc_traits::template rebind_traits< typename alloc_traits::const_pointer >::const_pointer const_pointer
Constant pointer type to contained elements.
const_iterable each() const noexcept
Returns an iterable object to use to visit a storage.
reverse_iterator rbegin() noexcept
Returns a reverse iterator to the beginning.
internal::storage_iterator< container_type, traits_type::page_size > iterator
Random access iterator type.
Type value_type
Type of the objects assigned to entities.
const_iterator begin() const noexcept
Returns an iterator to the beginning.
reverse_iterator rend() noexcept
Returns a reverse iterator to the end.
basic_storage & operator=(basic_storage &&other) noexcept
Move assignment operator.
Entity entity_type
Underlying entity identifier.
const_reverse_iterator rend() const noexcept
Returns a reverse iterator to the end.
underlying_iterator try_emplace(const Entity entt, const bool force_back, const void *value) override
Assigns an entity to a storage.
const_iterator cbegin() const noexcept
Returns an iterator to the beginning.
std::reverse_iterator< const_iterator > const_reverse_iterator
Constant reverse iterator type.
value_type & patch(const entity_type entt, Func &&...func)
Updates the instance assigned to a given entity in-place.
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator type.
std::size_t size_type
Unsigned integer type.
iterator insert(It first, It last, const value_type &value={})
Assigns one or more entities to a storage and constructs their objects from a given instance.
void pop(underlying_iterator first, underlying_iterator last) override
Erases entities from a storage.
typename container_type::pointer pointer
Pointer type to contained elements.
reverse_iterable reach() noexcept
Returns a reverse iterable object to use to visit a storage.
pointer raw() noexcept
Direct access to the array of objects.
std::tuple< value_type & > get_as_tuple(const entity_type entt) noexcept
Returns the object assigned to an entity as a tuple.
value_type & get(const entity_type entt) noexcept
Returns the object assigned to an entity.
const_reverse_iterator crend() const noexcept
Returns a reverse iterator to the end.
const_reverse_iterable reach() const noexcept
Returns a reverse iterable object to use to visit a storage.
iterable each() noexcept
Returns an iterable object to use to visit a storage.
void reserve(const size_type cap) override
Increases the capacity of a storage.
basic_storage(const allocator_type &allocator)
Constructs an empty storage with a given allocator.
value_type & emplace(const entity_type entt, Args &&...args)
Assigns an entity to a storage and constructs its object.
std::tuple< const value_type & > get_as_tuple(const entity_type entt) const noexcept
Returns the object assigned to an entity as a tuple.
void shrink_to_fit() override
Requests the removal of unused capacity.
void swap(basic_storage &other)
Exchanges the contents with those of a given storage.
const_reverse_iterator crbegin() const noexcept
Returns a reverse iterator to the beginning.
internal::storage_iterator< const container_type, traits_type::page_size > const_iterator
Constant random access iterator type.
basic_storage(basic_storage &&other, const allocator_type &allocator) noexcept
Allocator-extended move constructor.
iterator begin() noexcept
Returns an iterator to the beginning.
Allocator allocator_type
Allocator type.
constexpr null_t null
Compile-time constant for null entities.
constexpr tombstone_t tombstone
Compile-time constant for tombstone entities.
constexpr Type * uninitialized_construct_using_allocator(Type *value, const Allocator &allocator, Args &&...args)
Uses-allocator construction utility (waiting for C++20).
constexpr std::size_t fast_mod(const std::size_t value, const std::size_t mod) noexcept
Fast module utility function (powers of two only).
constexpr get_t< Type... > get
Variable template for lists of observed components.
constexpr bool operator<=(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) noexcept
Compares two hashed strings.
constexpr bool operator<(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) noexcept
Compares two hashed strings.
constexpr type_list< Type..., Other... > operator+(type_list< Type... >, type_list< Other... >)
Concatenates multiple type lists.
deletion_policy
Storage deletion policy.
@ swap_only
Swap-only deletion policy.
constexpr bool operator!=(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) noexcept
Compares two hashed strings.
constexpr bool operator>=(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) noexcept
Compares two hashed strings.
const type_info & type_id() noexcept
Returns the type info object associated to a given type.
@ ref
Aliasing mode, the object points to a non-const element.
constexpr bool operator>(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) noexcept
Compares two hashed strings.
constexpr auto to_address(Type &&ptr) noexcept
Unwraps fancy pointers, does nothing otherwise (waiting for C++20).
constexpr bool operator==(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) noexcept
Compares two hashed strings.
Common way to access various properties of components.
static constexpr std::size_t page_size
Page size, default is ENTT_PACKED_PAGE for non-empty types.
static constexpr bool in_place_delete
Pointer stability, default is false.
Utility class to create an iterable object from a pair of iterators.