Changelog
-
config
:- Added error messages to
ENTT_ASSERT
. - Added
ENTT_LAUNDER
to support older compilers that don't offerstd::launder
. - Replaced
ENTT_PAGE_SIZE
withENTT_SPARSE_PAGE
andENTT_PACKED_PAGE
. - Added
ENTT_NOEXCEPTION
to fully suppress support for exceptions. ENTT_NO_EXCEPT
is automatically defined.- Added
ENTT_THROW
,ENTT_TRY
andENTT_CATCH
.
- Added error messages to
-
core
:- Refined aggregate support in
any
to make it closer to its standard counterpart. - Added
make_any
andforward_as_any
functions. - Drastically reduced the number of instantiations/size of vtables due to
any
. - Added
basic_any<...>::owner
to know if the wrapper also owns the contained object. - Added traits
is_iterator[_v]
andis_iterator_type[_v]
.
- Refined aggregate support in
-
entity
:- Storage is always in a valid state upon component removal (component destructors can RW access their own pools).
- Updated
::raw
member function for views and groups to make it opaque (support for fancy pointers from storage). - Updated
basic_sparse_set<E>::remove
to make it work also with entities that aren't part of the set. - Added
basic_sparse_set<E>::erase
that works only with entities that are already in the set. basic_registry<E>::remove<T...>
also accepts entities that don't have the given components (replaces::remove_if_exists
).- Added
basic_registry<E>::erase<T...>
that triggers an error if the entities don't have the given components (it was::remove
). basic_handle<E>::remove<T...>
also accepts types that aren't assigned to the entity (replaces::remove_if_exists
).- Added
basic_handle<E>::erase<T...>
that triggers an error if the entity doesn't have the given components (it was::remove
). - Allocator support for sparse sets and storage classes.
to_entity
returnsentt::null
for invalid components.- Much faster
registry::create
for multiple entities (about twice the performance). basic_registry<E>::insert
andbasic_storage<E, T>::insert
with component array no longer require the end iterator.- Review of
entt_traits
design (added built-in functions::to_entity
,::to_integral
,::to_version
, and so on). - Entity type for class type identifiers is borrowed from
entity_type
member type (specializingentt_traits
is no longer required). - Exception safety for all storage functions is either strong or basic.
- Added the
tombstone_t
type and theentt::tombstone
constexpr variable for tombstone versions. - Updated the registry to skip the tombstone version and overflow to 0 on entity deletion.
- Added
null_t::operator|
to combine the null entity with any identifier (similar totombstone_t::operator|
). - Added
component_traits
(seecomponent.hpp
) to set the ETO policy (ignore_if_empty
) and the deletion policy (in_place_delete
). - Prevented groups from being mixed with tombstone.
- Added support to compact one, more or all pools from the registry API.
- Split
view
s andview_iterator
s, drastically reduced the number of instantiations due to views. - Added stable/packed storage policy support to views (automatic detection of the deletion policy).
- Added
basic_sparse_set<E>::policy
method for opaque runtime detection of the deletion policy. - Added support for storage policy (tombstones) to runtime views (automatic detection of the deletion policy).
- Support for in-place deletion and pointer stability upon deletion on a per-type basis with automatic detection during iterations.
- Support for pointer (and therefore reference) stability when assigning components to entities.
- Registry const
::view
/::group
function also support non-const types. - Added
::release
(aka force-destroy) overloads to the registry class. - Added
::released
function to the registry class to replace::destroyed
. - Fast path on non-view iterators for range
basic_registry<E>::destroy
. - Improved performance on component destruction (it affects multiple functionalities like destroying entities and components).
- Allow storage classes to inhibit component destruction for any reason.
- Added the
basic_sparse_set<E>::slot
function to return the next slot available for insertion. basic_sparse_set<E>::emplace
returns now the slot used for insertion.- Added
basic_sparse_set<E>::emplace_back
function to force back insertion (and skip the tombstone chain check). - Allow non-const types in const overloads of registry context variable getters.
-
meta
:- C-style arrays (eg
T[N]
orT[N][M]
) aren't treated as pointer-like types. - Added
make_meta
andforward_as_meta
functions. - Drastically reduced the number of instantiations/size of vtables due to
meta_any
.
- C-style arrays (eg
-
resource
:- Added a bunch of conversion functions to
resource_handle
.
- Added a bunch of conversion functions to
-
Performance improvements here and there (ie registry
::create
and::destroy
, component destruction/emplace/insert, ...).
Bug fixes
core
:basic_any<...>::operator=(const basic_any<...> &other)
can result in an invalid state whenother
isn't copyable.
Deprecated feature
-
core
:- Deprecated
std::reference_wrapper
support: usestd::in_place_type<T &>
, usemake_any
or::emplace<T &>
instead.
- Deprecated
-
entity
:basic_registry<E>::remove_if_exists
: use::remove
instead (it also supports iterators).basic_handle<E>::remove_if_exists
: use::remove
instead (it also supports iterators).basic_registry<E>::remove_all
: use::destroy(e); ::create(e)
instead.basic_handle<E>::remove_all
: no longer supported.basic_registry<E>::reserve_pools
: no longer supported.basic_registry<E>::destroyed
: use::released
instead.
-
meta
:- Deprecated
std::reference_wrapper
support: usestd::in_place_type<T &>
, usemake_meta
or::emplace<T &>
instead.
- Deprecated
Breaking changes
-
config
:ENTT_ASSERT
now receives two arguments (condition and error message).- Removed
ENTT_PAGE_SIZE
, useENTT_SPARSE_PAGE
andENTT_PACKED_PAGE
instead. - Defining
ENTT_NO_EXCEPT
triggers an error, useENTT_NO_EXCEPTION
to fully disable exceptions instead.
-
core
:- Removed
entt::is_empty[_v]
andENTT_IS_EMPTY
, no longer required/supported.
- Removed
-
entity
view::raw
andgroup::raw
return now a paged array of components (for pointer stability).basic_registry<E>::insert
andbasic_storage<E, T>::insert
no longer require the end iterator.- No longer required to specialize
entt_traits
. Otherwise, provide member function::to_entity
,::to_version
, and so on. - Removed
about_to_pop
virtual function from the sparse set class.
-
poly
:- Removed
std::reference_wrapper
support (reference in-place construction still available).
- Removed
-
process
:process::dead
has been renamed toprocess::finished
.
Any other business
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I started a long term process to reduce the number of instantiations and also speed up the compilation.
This release contains many changes and great improvements in this regard. Still a work in progress though.