Releases: skypjack/entt
EnTT v3.11.0
Changelog
-
config:- Decouple
ENTT_NOEXCEPTand exceptions handling - Added
ENTT_CONSTEXPR(to get around some nasty issues with major compilers) - Added
ENTT_ASSERT_CONSTEXPR(to help further with extreme customizations)
- Decouple
-
container:- Dense map
max_size,countandequal_rangefunctions - Dense set
max_size,countandequal_rangefunctions
- Dense map
-
core:- A new
forward_applyutility type_list_index[_v]utility for type liststype_list_transform[_t]utility for type listsnth_argumentutility to easily extract the n-th argument of a functioniota_iterator(waiting for C++20)- Added
operator*toinput_iterator_poointer - Turn
operator!=foranyinto an in-class function - Avoid using
std::aligned_storage_twithany(deprecated since C++23) - Utility
is_tuple[_v]
- A new
-
entity- Correctly handle overflow of version and max number of entities
- Turned
get_tandexclude_tinto plain aliases fortype_list - Updated API for
basic_registry<...>::group/group_if_exists basic_sparse_set<...>::getis now[[nodiscard]]ignore_as_empty_v<void>is always true- Support
storage<void>as a typeless storage only - Added allocator support to
sigh_storage_mixin - Views support now both const and non-const excluded types
- Groups support now both const and non-const excluded types
- Tuple-based constructor for views
- Added utilities
storage_type_tandstorage_for[_t] - Runtime views support all types of sparse sets now (allocator oriented design)
- Observers support all types of registries now (allocator oriented design)
- Snapshots and loaders support all types of registries now (allocator oriented design)
as_groupandas_vieware transparent to the registry type (allocator oriented design)- Handles support all types of registries now (allocator oriented design)
invokeandto_entityhelpers support all types of registries now (allocator oriented design)- Organizers support all types of registries now (allocator oriented design)
- Storage-based model for groups and views (👈 this is huge 🥳 )
- Replaced
basic_handle<...>::visitwith::storageto return an iterable object rather than accepting lambdas - The
organizerclass uses the newflowbuilder under the hood - Added const/non-const registry support to runtime views
- Runtime views are now allocator aware containers
- Observers derive directly from storage classes rather than using them internally
- Relaxed most of the entity validity checks in a registry
- Added registry context
getfunction, deprecatedat - Added registry context
emplace_asfunction, deprecatedemplace_hint - Added registry context
insert_or_assignfunction - Merged virtual functions
swap_and_popandin_place_pop, storage classes only have to implementpopnow - Full support to non-movable types, component types have no more constraints (👈 this is huge 🥳)
- Partial allocator support for the
basic_registry<...>class (registry allocators also propagate to their pools) - Registry
swapandget_allocatorfunctions - Guaranteed order of destruction of the parts of a registry (context variables, components, ...)
- Allocator support for
storage_type[_t]andstorage_for[_t] - Added
basic_view<...>::refreshto reinitialize the leading pool of a view
-
graph(👈 new module):adjacency_matrixclass with support for directed and undirected graphs- Runtime organizer class (
flow) to create execution graphs from tasks and resource requirements - Basic
dotfunctions to convert an execution graph (and a graph in general) to the dot format
-
locator:- Support exporting and setting services across boundaries using opaque handles (see functions
handleandreset)
- Support exporting and setting services across boundaries using opaque handles (see functions
-
meta:- Container traits don't really support plain arrays anymore (if they ever did)
- Fixed an issue with
insert/eraseof meta sequence containers - Re-added
meta_type::remove_pointer - Added
meta_type::is_integralandmeta_type::is_signed meta_associative_container::erasereturns the number of elements removedmeta_rangeis now an alias template ofiterable_adaptorvoid *-to-meta_anyutility function formeta_types- Improve automatic detection of meta sequence containers
std::listandstd::dequeare also supported as meta sequence containers- Turn
operator!=formeta_anyinto an in-class function - All meta node (i.e.
meta_data_node,meta_func_nodeand so on) are no longer static - It's now possible to attach multiple properties to a meta object at different times
meta_constructalso accepts lambdas- Support to const/non-const overloads for the same meta function
- Context support (👈 this is huge 🥳), see the official documentation for further details
- Favor top-level conversion functions over bases lookup
-
poly:- Avoid using
std::aligned_storage_twithpoly(deprecated since C++23)
- Avoid using
-
process:- Added an
fwd.hppfile for the submodule
- Added an
-
resource:- Added more comparison operators for resource handles
- Added type members
handle_typeandelement_type - Added member function
handleto access the underlying handle
-
signal:- Full review of the
emitterclass dispatcheruses now anstd::allocator<void>by defaultsighuses now anstd::allocator<void>by default- Added allocator support to
basic_emitter
- Full review of the
Any other business:
- A good amount of functions and types were reviewed to make them
constexpr - A good amount of functions and types are now (conditionally)
noexceptno matter what - Added some utilities test to make all them work also in release mode (see
ENTT_DEBUG_TESTand the others) - Workflow
iwyu(I'll keep an eye on it and refine things a bit at a time) - Removed the aob target from cmake
Natvis support
All natvis files have been updated where necessary.
There exists a new natvis file named graph.natvis for the newly added submodule.
Breaking changes
-
config:ENTT_NOEXCEPT[_IF]no longer exists
-
core:identifierwas renamed toidentident::identifer_typewas renamed toident::value_typefamily::family_typewas renamed tofamily::value_type
-
entity:- Drop the
entity/utility.hppfile, usefwd.hppinstead - Updated API for
basic_registry<...>::group/group_if_exists basic_registry<...>::storage<T>doesn't accept const types anymorestorage_traitswas renamed tostorage_typestorage_type::storage_typewas renamed tostorage_type::type- Entity and component type were flipped in the definition of the
basic_storageclass template - Entity and component type were flipped in the definition of the
storage_typeutility basic_handle<...>::visitwas removed, use::storageinstead (iterable model)basic_registry<...>::storage(id)returns a (possibly null) pointer rather than an utterly annoying iterator
- Drop the
-
meta:- Container traits don't really support plain arrays anymore (if they ever did)
- Removed
meta_type::base(id)because pointless - Meta data and meta functions no longer return the associated id from the API
- Meta range iterators return now an id and meta object pair (i.e. for meta data or functions from a meta type)
- Only the single property API is now available for attaching properties to meta objects (no more
meta_factory<...>::props) make_metais no longer available (it doesn't fit with context support), usemeta_anyconstructors directly instead
-
resource:- Removed
resource::use_count, usehandle().use_count()instead
- Removed
-
signal:- Full review of the
emitterclass
- Full review of the
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.
EnTT v3.10.3
Changelog
entity:- Fix an issue that makes storage cross range-erase break when using built-in iterators.
Any other business
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
EnTT v3.10.2
Changelog
entity:- Fix an issue that makes sparse set cross range-erase break when using built-in iterators.
Any other business
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
EnTT v3.10.1
Changelog
-
config:- Decouple
ENTT_NOEXCEPTand exceptions handling
- Decouple
-
entity:- Correctly handle overflow of version and max number of entities
-
meta:- Container traits don't really support plain arrays anymore (if they ever did)
- Fixed an issue with
insert/eraseof meta sequence containers - Re-added
meta_type::remove_pointer
-
signal:- Added more comparison operators for resource handles
Any other business
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
EnTT v3.10.0
Changelog
-
config:- Added the
macro.hfile with a couple of utilities - Export the
ENTT_VERSIONstring - Detect version and configuration mismatches automatically on Windows
- Added the
-
container:- Uses-allocator construction guaranteed for
dense_set - Uses-allocator construction guaranteed for
dense_map dense_mapiterators are in the input iterator category but model either a forward (local) or a random (default) iteratordense_map::value_typeis eitherpair<const T &, U &>orpair<const T &, const U &>(zip iterator type)- No more risky UBs due to type punning or destroy/construct within a vector for a
dense_map - Strong exception guarantee for
emplaceandinsertfunctions of thedense_mapclass - Strong exception guarantee for
emplaceandinsertfunctions of thedense_setclass
- Uses-allocator construction guaranteed for
-
core:- Store size with hashed strings
- Decouple begin/end iterator types of
iterable_adaptor - Utility
uses_allocator_construction_args(waiting for C++20) - Utility
make_obj_using_allocator(waiting for C++20) - Utility
uninitialized_construct_using_allocator(waiting for C++20) - Added utilities
allocation_deleterandallocate_unique(with uses-allocator construction guaranteed) compressed_paircorrectly manages references with piecewise constructionENTT_NOEXCEPT_IF(for future uses)- Added an overload of
type_idto get atype_infofrom a variable - Allow to construct
type_infoobjects directly (no static storage duration in this case)
-
entity:- Optimized runtime view iterators
- Weak
basic_registry<...>::storagefor opaque operations across (eventually different) registries basic_runtime_view<...>::iterate/excludemember functions to attach pools at runtimebasic_sparse_set<...>::emplacereturns an iterator to the inserted element (or the end iterator in case of errors)basic_sparse_set<...>::insertreturns an iterator to the inserted elements (or the end iterator in case of errors)sigh_storage_mixinalways triggers an emplace request notification (in sync with unbalanced destroy)- Chained constructors support (ie parent-to-child propagation) for default storage classes
- Arguments provided to storage classes are always discarded for empty types
- Standalone registry context type returned by the
.ctx()method, all context functionalities are part of its API now - Support to named context variables (through
emplace_hint) basic_registry<...>::storage<T>is no longer[[nodiscard]]basic_registry<...>::storage<T>also supports const qualified types- Sparse set's iterators'
::indexreturns the right index (that is,offset - 1) - Internal hook
basic_sparse_set<...>::try_emplacewas changed to return an iterator to the inserted element (orend()) - Internal hook
basic_sparse_set<...>::try_emplacewas changed to accept an additional booleanforce_backparameter basic_sparse_set<...>::insertalways appends elements rather than trying to fill tombstones if anybasic_storage<...>::insertalways appends elements rather than trying to fill tombstones if any- Internal hook
basic_sparse_set<...>::swap_and_popwas changed to accept a couple of iterators - Internal hook
basic_sparse_set<...>::in_place_popwas canged to accept a couple of iterators basic_sparse_set<...>::clearno longer creates tombstones (it actually removes all of them)- Automatic traits deduction for the component class, drop
basic_component_traits - Uses-allocator construction guaranteed for storage classes
- All storage classes support entity and component types with custom swap functions
basic_sparse_set<...>::bumpto force-refresh an entity version- Drop
component_traits::::ignore_if_empty, use::page_size0 for empty types - Allow creating pool during a call to
basic_registry<...>::destroy(ie from a listener) - Added a constructor to reserve enough memory for N pools on creation
-
locator:- Renamed
service_locatortolocator - Allocator support when creating new services (see
allocate_emplace)
- Renamed
-
meta:meta_type::invokealso searches into the base types for a candidate function- Added a compile-time check to prevent attaching a type as a meta base of itself
- Meta sequence containers iterators belong to the input iterator category but model a forward iterator
- Relaxed meta sequence containers requirements
- Dereferencing a pointer-like object that converts to bool works in all cases (false implies empty
meta_any)
-
process:- Allow attaching tasks to a
schedulerfrom already running processes
- Allow attaching tasks to a
-
resource:- Make resource handles equality comparable
- Removed class
resource_loader, made the loader a template parameter of theresource_cache - Full review of the
resource_cacheAPI and functionalities - Full review of the
resource_handle(nowresource) class - Added a transparent
resource_loaderfor basic cases
-
signal:- Renamed
delegate::instancetodelegate::data - Added support for named queues to the
basic_dispatcherclass - Enable fetching the number of pending events from a
basic_dispatcher - Allocator support for the
basic_dispatcherclass
- Renamed
-
Performance improvements:
- Improved performance for
basic_registry<...>::remove - Improved performance for
basic_registry<...>::erase - Blazing fast
basic_sparse_set<...>::clear - Blazing fast
basic_sparse_set<...>::erasewhen usingbasic_sparse_set<...>::[const_]iterators
- Improved performance for
-
Build system:
- Removed the in-source build check
Natvis support
- Added info about the sparse array of a sparse set (non-null elements only)
- Updated representation for hashed strings (also include size)
- Updated representation for the registry context
- Updated representation for dense map and dense set
- Updated representation for all classes in the resource module
Breaking changes
-
container:dense_hash_mapwas renamed todense_mapdense_hash_setwas renamed todense_set
-
core:- Removed
is_iterator_type[_v], no alternative provided - Removed
ENTT_LAUNDER
- Removed
-
entity:basic_runtime_views do not have a vector-based constructor anymore, use::iterateand::excludeinsteadbasic_registry<...>::runtime_viewno longer exists, use the default constructor, then::iterateand::exclude- Registry context functionalities have been moved to the standalone registry context class and are now part of its API
basic_sparse_set<...>::slotis no longer available, no alternative providedbasic_sparse_set<...>hooks were slightly changed for performance reasonsbasic_component_traitsdoesn't exist anymore, all values should be specified explicitly- Renamed
basic_registry<...>::sortabletobasic_registry<...>::owned component_traits::::ignore_if_emptyisn't available anymore, set thepage_sizeto 0 to avoid creating empty types
-
locator:- Renamed
service_locatortolocator - Full review of the
locator's API (all functions are still there but they've likely a different name)
- Renamed
-
resource:- Removed class
resource_loader, made the loader a template parameter of theresource_cache - Full review of the
resource_cacheAPI and functionalities - Full review of the
resource_handle(nowresource) class
- Removed class
-
signal:delegate::instancedoesn't exist anymore, usedelegate::datainstead
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.
EnTT v3.9.0
Changelog
-
container:- Introduced a new
dense_hash_mapclass that is mostly a drop-in replacement forstd::unordered_map. - Introduced a new
dense_hash_setclass that is mostly a drop-in replacement forstd::unordered_set.
- Introduced a new
-
core:- Added
type_infoconstructor with in-place type (as instd::in_place_type_t<T>). - Added the new class
compressed_pairfor internal uses but also available to the final user (with support to structured binding). - Added
is_ebco_eligible[_v]utility. any_castno longer forces by-copy construction for rvalues.- Added enum-as-bitmask support for enum classes.
- Created a new
memory.hppheader to support/offer general purpose functions generally missed in the standard library. - Added
to_addressto unwrap fancy pointers, waiting for C++20. - Added
propagate_on_container_copy_assignment,propagate_on_container_move_assignmentandpropagate_on_container_swap. - Constexpr function
is_power_of_two, it's mainly meant for internal uses but also generally available. - Constexpr function
fast_mod, it's mainly meant for internal uses but also generally available. - Created a new
tuple.hppheader to support/offer general purpose functions generally missed in the standard library. - Utility
unwrap_tuple, it's mainly meant for internal uses but also generally available. constexprsupport fortype_info.basic_any<...>::typereturns the object type if any,type_id<void>()(and not an emptytype_info) otherwise.- Added optional
const type_info ¶meter (requested type) tobasic_any<...>::data. operator<,operator<=,operator>andoperator>=forbasic_hashed_string.operator<,operator<=,operator>andoperator>=fortype_info.type_idreturnstype_infoobjects with static storage duration.- Added
basic_any<...>::assignto copy or move assign the wrapped value without replacing it. - Added
to_entityandto_versionasideto_integral, they forward the request to the rightentt_traits<...>class. - New
input_iterator_pointerutility class. - Constexpr function
next_power_of_two, it's mainly meant for internal uses but also generally available. - Added
is_transparent[_v]utility class. - An
is_transparenttype member is now part of theidentityclass. iterable_adaptorutility to create a temporary iterable object from two iterators.
- Added
-
entity:- Added
in_place_delete[_v]andignore_as_empty[_v]utilities. basic_sparse_set<...>is a non-copyable allocator-aware container (::get_allocator(), pocma/pocca/pocs support, and so on).basic_storage<...>is a non-copyable allocator-aware container (::get_allocator(), pocma/pocca/pocs support, and so on).- Empty allocators are elided by exploiting EBCO.
- All storage classes offer a
get_as_tuplefunction. - Added
owned_tbesidesget_tandexclude_t. - Included destroyed list head in the entity count when creating a snapshot.
entt_traitsis now a first class citizen of the library and all entity related requests rely on it (see::combineand so on).basic_registry<...>::currentreturns a tombstone version for invalid entities and doesn't assert anymore.- Added
basic_sparse_set<...>::currentto return known version of identifiers in set. - Sparse arrays also contain updated entity versions, no more unused bits (out-of-sync support).
- Sparse sets manage correctly foreign entities in all cases, the version is always taken in consideration now.
- No tombstone checks for multi-type views, zero-cost pointer stability model.
- Added empty
::getmethod to storage for empty types. - In-place delete always fills holes before appending new elements during an
::insert. - Generalized
::insertfor all mixins. - Storage types are safe to use from the base class in all cases, no more risky corner cases.
- Decoupled sparse set iterators from allocators to reduce instantiations.
- Decoupled storage iterators from allocators to reduce instantiations.
- Added
basic_view<...>::operator[]overload to access (eventually unwrapped) components by entity. operator->for iterable objects iterators (iterable view, iterable group).- Added
basic_view<...>::handleto return a const reference to the leading storage. - Non-const to const conversion guaranteed for storage iterators.
- Include
fwd.hppfromentity.hppto makeentityavailable in all cases. - Make
basic_registry<...>::all_of,basic_registry<...>::any_ofand a few other functions remove const qualifiers. - Make
is_iterator[_v]also supportvoid *andconst void *. - Tuple-like type support for
is_equality_comparable[_v]. - Support for views with multiple components of the same type (i.e.
view<E, T, T, T>). - Added
basic_view<...>::use<integral value>()to set leading pool by index. - Added
basic_view<...>::get<integral value>(e)to get components by index. - Make the
basic_registryclass work smoothly across boundaries. - Use a dense hash map to store context variables.
- Removed the
void *custom argument frombasic_sparse_set::remove,::erase,::emplace,::insert,::clear. - Added a
bindfunction to thebasic_sparse_setto pass the outer context to mixins. - Fully removed the poly storage support.
- Make a const
basic_registryfully thread-safe (with placeholder pools). swapis not longer virtual in thebasic_sparse_set.- Allow emplacing opaque values (
void *) from abasic_sparse_set. - Allow getting the value type of the derived class from a
basic_sparse_setwith::type, if any. - Allow getting the value associated to an entity from a derived class as an opaque pointer (
void *) with::get, if any. - Removed
basic_registry::prepare. - Added
basic_registry::storage<T>to get or create pools at runtime and bind them to a custom name if needed. - Make
to_entityalso work with stable types. - Turned
basic_component_traits::in_place_deleteinto a boolean value. - Turned
basic_component_traits::ignore_if_emptyinto a boolean value. - Added
basic_component_traits::page_sizeto allow customizing the packed page size on a per-type basis. - Removed
in_place_delete_v. - Added
basic_view::storage<T>to get pools at runtime if needed. - Added
basic_group::storage<T>to get pools at runtime if needed. - Added
entt_traits::page_sizeto allow customizing the sparse page size on a per-type basis. - Added
basic_group<...>::handleto return a const reference to the leading storage. - Multi-type views' iterators are in the forward iterator category now.
- Iterable views (
.each()) do not offer reverse iterators anymore (cannot implement them correctly). - Iterable groups (
.each()) do not offer reverse iterators anymore (cannot implement them correctly). - Added
basic_sparse_set<...>::cbegin/::cend/crbegin/crendand theconst_iteratorandconst_reverse_iteratortype members. basic_storage<...>::eachfunction to iterate a storage as a set of entity/component tuples.- Views and groups iterators are also default constructible and a default constructed iterator always compares to
end. - Added
basic_registry<...>::storage()to return pools and their names as an iterable object.
- Added
-
meta:meta_type::constructdoesn't look for base constructors anymore.- Container support review (less instantiations, faster to compile).
- Meta sequence containers
::insertreturns now an iterator that is contextually convertible to bool (for validity checks). - Meta sequence containers
::erasereturns now an iterator that is contextually convertible to bool (for validity checks). meta_argutility doesn't require anstd::index_sequenceanymore.- The list of types to
meta_argis now a type list template parameter instead of a function parameter. meta_constructutility doesn't require anstd::index_sequenceanymore.meta_invokeutility doesn't require anstd::index_sequenceanymore.- A public
meta_dispatchutility is now available. - Removed
meta_type::is_void. - Add
fwd.hppfile for many types in meta. - Non-template version of
meta_any::allow_castthat works with meta types. - Removed
parentlink from meta objects. - Lambda support for
meta_invokeandmeta_constructutilities. - Replaced
meta_type::resetwith themeta_resetfree functions. - Added
cbeginandcendtometa_range. - Added
meta_type::is_arithmeticto replaceis_integralandis_floating_point. - Automatic arithmetic conversion support to mimic what the language offers out of the box.
- Automatic enum conversion support to/from underlying type.
- Multi-setter support for
meta_data(meta data members). - Added
meta_any::assignto copy or move assign the wrapped value without replacing it. operator->for meta containers iterators.operator->formeta_rangeiterators.- Static functions that require the parent type as first argument are treated as (eventually const) member functions.
- Non-const to const conversion guaranteed for
meta_rangeiterators. - Extended support to base members when attached to meta types for derived classes.
- Define
meta_associative_container_traitsfordense_hash_map. - Define
meta_associative_container_traitsfordense_hash_set. - Member functions can be used as meta destructors.
- Policies also check function return types at compile-time.
- Added
meta_any::ownerto know if ameta_anyalso owns the underlying object.
-
poly:- Single function vtable optimization to avoid indirections.
-
resource:- Added
resource_handle::use_countto k...
- Added
EnTT v3.8.1
Changelog
-
core:- Make
is_equality_comparable[_v]work with iterators that have a non-comparablevalue_type.
- Make
-
entity:- Suppress warning for discarding a
nodiscardvalue in the snapshot class. - Removed an inconsistent test that fails sporadically.
- Suppress warning for discarding a
-
meta:- Avoid a risky fallthrough in the
meta_anyvtable.
- Avoid a risky fallthrough in the
Bug fixes
- Fixed an UB when id type is
std::uint64_t. - Fixed a sparse set class issue with pages not always properly created during an emplace when in-place deletion policy is enabled.
Build system
Added everything needed to also run tests with id type std::uint64_t on the CI.
Deprecated feature
None.
Breaking changes
None.
Any other business
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
EnTT v3.8.0
Changelog
-
config:- Added error messages to
ENTT_ASSERT. - Added
ENTT_LAUNDERto support older compilers that don't offerstd::launder. - Replaced
ENTT_PAGE_SIZEwithENTT_SPARSE_PAGEandENTT_PACKED_PAGE. - Added
ENTT_NOEXCEPTIONto fully suppress support for exceptions. ENTT_NO_EXCEPTis automatically defined.- Added
ENTT_THROW,ENTT_TRYandENTT_CATCH.
- Added error messages to
-
core:- Refined aggregate support in
anyto make it closer to its standard counterpart. - Added
make_anyandforward_as_anyfunctions. - Drastically reduced the number of instantiations/size of vtables due to
any. - Added
basic_any<...>::ownerto 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
::rawmember function for views and groups to make it opaque (support for fancy pointers from storage). - Updated
basic_sparse_set<E>::removeto make it work also with entities that aren't part of the set. - Added
basic_sparse_set<E>::erasethat 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_entityreturnsentt::nullfor invalid components.- Much faster
registry::createfor multiple entities (about twice the performance). basic_registry<E>::insertandbasic_storage<E, T>::insertwith component array no longer require the end iterator.- Review of
entt_traitsdesign (added built-in functions::to_entity,::to_integral,::to_version, and so on). - Entity type for class type identifiers is borrowed from
entity_typemember type (specializingentt_traitsis no longer required). - Exception safety for all storage functions is either strong or basic.
- Added the
tombstone_ttype and theentt::tombstoneconstexpr 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
views andview_iterators, 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>::policymethod 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/::groupfunction also support non-const types. - Added
::release(aka force-destroy) overloads to the registry class. - Added
::releasedfunction 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>::slotfunction to return the next slot available for insertion. basic_sparse_set<E>::emplacereturns now the slot used for insertion.- Added
basic_sparse_set<E>::emplace_backfunction 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_metaandforward_as_metafunctions. - 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
::createand::destroy, component destruction/emplace/insert, ...).
Bug fixes
core:basic_any<...>::operator=(const basic_any<...> &other)can result in an invalid state whenotherisn't copyable.
Deprecated feature
-
core:- Deprecated
std::reference_wrappersupport: usestd::in_place_type<T &>, usemake_anyor::emplace<T &>instead.
- Deprecated
-
entity:basic_registry<E>::remove_if_exists: use::removeinstead (it also supports iterators).basic_handle<E>::remove_if_exists: use::removeinstead (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::releasedinstead.
-
meta:- Deprecated
std::reference_wrappersupport: usestd::in_place_type<T &>, usemake_metaor::emplace<T &>instead.
- Deprecated
Breaking changes
-
config:ENTT_ASSERTnow receives two arguments (condition and error message).- Removed
ENTT_PAGE_SIZE, useENTT_SPARSE_PAGEandENTT_PACKED_PAGEinstead. - Defining
ENTT_NO_EXCEPTtriggers an error, useENTT_NO_EXCEPTIONto fully disable exceptions instead.
-
core:- Removed
entt::is_empty[_v]andENTT_IS_EMPTY, no longer required/supported.
- Removed
-
entityview::rawandgroup::rawreturn now a paged array of components (for pointer stability).basic_registry<E>::insertandbasic_storage<E, T>::insertno 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_popvirtual function from the sparse set class.
-
poly:- Removed
std::reference_wrappersupport (reference in-place construction still available).
- Removed
-
process:process::deadhas 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.
EnTT v3.7.1
Changelog
-
core:- Extended support to both aggregates and non-aggregates type for
any. - No more redundant copies in
anywhen emplacing (as in.emplace<T>(args...)). - No more redundant copies in
anywhen emplacing (as in= value). - No more redundant copies in
anywhen resetting (as in.reset()).
- Extended support to both aggregates and non-aggregates type for
-
entity:- Updated iterable views (
view.each()) to make them work with<algorithm>in all cases. - Updated iterable groups (
group.each()) to make them work with<algorithm>in all cases.
- Updated iterable views (
-
meta:- Extended support to both aggregates and non-aggregates type for
meta_any. - No more redundant copies in
meta_anywhen emplacing (as in.emplace<T>(args...)). - No more redundant copies in
meta_anywhen emplacing (as in= value). - No more redundant copies in
meta_anywhen resetting (as in.reset()). - Reduced instantiations due to
meta_prop.
- Extended support to both aggregates and non-aggregates type for
Bug fixes
None
Breaking changes
core:- Removed trait
is_std_hashable[_v].
- Removed trait
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 therefore speed up the compilation.
This release contains some more changes in this regard. Still a work in progress though.
EnTT v3.7.0
Changelog
core:- Added support for non-copyable types to
any. - Standard containers friendly
is_equality_comparabletrait. - Added
type_list_diff[_t]trait. - Added
any::reset(). - Copying an
anyalways returns a copy of the contained object, even in case of references to external elements. - Added
is_std_hashable[_v]trait. type_id<T>()is a[[nodiscard]]function now.any::as_refis a member function rather than an in-class friend function exported in the global namespace.basic_anysupports configurable sbo size,anyis an alias forbasic_any<sizeof(double[2])>.- Added eventually constexpr conversion operator to underlying type to
type_seq. - Added eventually constexpr conversion operator to underlying type to
type_hash. - Added eventually constexpr conversion operator to underlying type to
type_name. basic_anytakes now in consideration implicit alignment requirements for in_situ tests.- Added an extra parameter to
basic_anyto specify desired alignment requirements for the SBO storage.
- Added support for non-copyable types to
entity:- Avoid UB with
sparse_set::clearand component-lessregistry::clear. - Use
entt::anyto store context variables in a registry. registry::storagereturns actual references (eventually const) to the poly storage objects.- Added
basic_sparse_set<E>::atto get entities at given positions. - Stable virtual
removefor sparse sets. - Poly storage no longer has a
removemember function by default. - Faster
registry::clearthat delegates to pools. - Added optional user data to
basic_sparse_set<E>::removeandbasic_sparse_set<E>::clear. - Simplified
sigh_storage_mixin, less instantiations, less code, same functionalities. - Added unchecked
basic_sparse_set<E>::operator[](pos). - Added support to aliased context variables (externally managed objects attached to a registry by reference).
- Added an
operator|to views for piping that creates a new view rather than a view pack. - Non-allocating non-const
registry::try_get.
- Avoid UB with
meta:- Implicitly generated default meta constructors for default constructible types.
- Pointer-like to
voidsupport (dereference to invalidmeta_any). - All overloads of
meta_type::basereturn instances ofmeta_typenow. - User defined getters are detected as are data members (
is_invocable<F, [const] T &>instead ofis_invocable<F, [const] T *>). as_ref_tadapts to the constness of the underlying object/return type,as_cref_talways returns by const reference.- Added
meta_any::reset(). - Internal utilities (like
meta_function_descriptorandmeta_invoke) are now public for use as needed. - Support for
std::vector<bool>and the like as meta containers. - Added support for self-pointers and proxy pointers to
meta_anywhen used as pointer-like types. - Added explicit const
meta_handle::operator bool(). - Copying a
meta_anyalways returns a copy of the contained object, even in case of references to external elements. - Added minimal customizable class template detection support to
meta_type(see for exampleis_template_specialization). meta_any::operator==is now consistent across boundaries.meta_any::as_refis a member function rather than an in-class friend function exported in the global namespace.- Re-registering meta objects is safe in all cases unless the meta objects has a name and the id is already used by a different element (hard user error).
- A
meta_propkey is now returned by const reference rather than by copy. - Removed
has_meta_sequence_container_traits[_v]andhas_meta_associative_container_traits[_v]. - Meta destructors are no longer invoked for non-owning
meta_anyobjects.
resource:- Removed the requirement for
shared_ptr<T>from the loader/cache.
- Removed the requirement for
poly:- Added
poly::reset(). - Copying a
polyalways returns a copy of the contained object, even in case of references to external elements. poly<T>::as_refis a member function rather than an in-class friend function exported in the global namespace.polysupports configurable sbo size with a default ofsizeof(double[2]).- Added an extra parameter to
polyto specify desired alignment requirements for the underlying storage.
- Added
signal:- Made
dispatcherclass work fine withstd::is_copy_constructible.
- Made
- Build system:
- Updated
Bazelconfiguration. - Added
pkg-configsupport upon installation. - Use
lcovfor code coverage on the CI.
- Updated
Bug fixes
entity:- Fixed an issue with
registry::clear. There are two ways to get around it in v3.6.x:registry.each([&](auto entity) { registry.destroy(entity); });if interested in signals.registry = {};if not interested in signals.
- Fixed an issue with
Breaking changes
core:- In-place construction of references in
anyrequires the argument to be an actual lvalue reference and not a pointer. - Copying an
anyalways returns a copy of the contained object, even in case of references to external elements. Move theanyobject, pass it by reference or useas_refto propagate elements without copying them. - Free function
as_refno longer exists forany, useany::as_ref()instead. ENTT_PAGE_SIZEsets the number of elements of a page, not the size in bytes.
- In-place construction of references in
entity:- Removed
registry::raw<T>(), useregistry.view<T>().raw()instead. - Removed
registry::data<T>(), useregistry.view<T>().data()instead. - Updated precondition of
registry::assign(all pools empty -> no entities still alive). - Renamed
registry::has<T...>toregistry::all_of<T...>andregistry::any<T...>toregistry::any_of<T...>. - Renamed
handle::has<T...>tohandle::all_of<T...>andhandle::any<T...>tohandle::any_of<T...>. registry::storagereturns poly storage objects by reference rather than by copy. Capture them by reference before using.- Poly storage no longer has a
removemember function by default. - Const
registry::viewis no longer thread safe.
- Removed
meta:- Removed
meta_conv, it's used internally when needed (egmeta_any::allow_cast). - Removed
meta_base, it's used internally when needed (egmeta_any::cast). - All overloads of
meta_type::basereturn instances ofmeta_typenow. - Meta iterators for associative containers return keys as const references and no longer by copy.
meta_handle::operator*isn't available anymore, no alternatives provided.- Copying a
meta_anyalways returns a copy of the contained object, even in case of references to external elements. Move themeta_anyobject, pass it by reference or useas_refto propagate elements without copying them. - Renamed
meta_ctor::sizeandmeta_func::sizetometa_ctor::arityandmeta_func::arity. - Deleted
meta_handlecopy constructor. No alternatives provided. Meta handles should never be copied. - Free function
as_refno longer exists formeta_any, usemeta_any::as_ref()instead. - Removed
has_meta_sequence_container_traits[_v], useentt::is_complete_v<entt::meta_sequence_container_traits<T>>instead. - Removed
has_meta_associative_container_traits[_v], useentt::is_complete_v<entt::meta_sequence_associative_traits<T>>instead.
- Removed
poly:- Copying a
polyalways returns a copy of the contained object, even in case of references to external elements. Move thepolyobject, pass it by reference or useas_refto propagate elements without copying them. - Free function
as_refno longer exists forpoly<T>, usepoly<T>::as_ref()instead.
- Copying a
Any other business
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the section EnTT in Action with more and more examples.
I started a long term process to reduce the number of instantiations and therefore speed up the compilation.
This release contains some more changes in this regard. Still a work in progress though.