Skip to content

Releases: skypjack/entt

EnTT v3.11.0

09 Nov 11:24

Choose a tag to compare

Changelog

  • config:

    • Decouple ENTT_NOEXCEPT and exceptions handling
    • Added ENTT_CONSTEXPR (to get around some nasty issues with major compilers)
    • Added ENTT_ASSERT_CONSTEXPR (to help further with extreme customizations)
  • container:

    • Dense map max_size, count and equal_range functions
    • Dense set max_size, count and equal_range functions
  • core:

    • A new forward_apply utility
    • type_list_index[_v] utility for type lists
    • type_list_transform[_t] utility for type lists
    • nth_argument utility to easily extract the n-th argument of a function
    • iota_iterator (waiting for C++20)
    • Added operator* to input_iterator_poointer
    • Turn operator!= for any into an in-class function
    • Avoid using std::aligned_storage_t with any (deprecated since C++23)
    • Utility is_tuple[_v]
  • entity

    • Correctly handle overflow of version and max number of entities
    • Turned get_t and exclude_t into plain aliases for type_list
    • Updated API for basic_registry<...>::group/group_if_exists
    • basic_sparse_set<...>::get is 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_t and storage_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_group and as_view are transparent to the registry type (allocator oriented design)
    • Handles support all types of registries now (allocator oriented design)
    • invoke and to_entity helpers 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<...>::visit with ::storage to return an iterable object rather than accepting lambdas
    • The organizer class uses the new flow builder 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 get function, deprecated at
    • Added registry context emplace_as function, deprecated emplace_hint
    • Added registry context insert_or_assign function
    • Merged virtual functions swap_and_pop and in_place_pop, storage classes only have to implement pop now
    • 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 swap and get_allocator functions
    • Guaranteed order of destruction of the parts of a registry (context variables, components, ...)
    • Allocator support for storage_type[_t] and storage_for[_t]
    • Added basic_view<...>::refresh to reinitialize the leading pool of a view
  • graph (👈 new module):

    • adjacency_matrix class with support for directed and undirected graphs
    • Runtime organizer class (flow) to create execution graphs from tasks and resource requirements
    • Basic dot functions 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 handle and reset)
  • meta:

    • Container traits don't really support plain arrays anymore (if they ever did)
    • Fixed an issue with insert/erase of meta sequence containers
    • Re-added meta_type::remove_pointer
    • Added meta_type::is_integral and meta_type::is_signed
    • meta_associative_container::erase returns the number of elements removed
    • meta_range is now an alias template of iterable_adaptor
    • void *-to-meta_any utility function for meta_types
    • Improve automatic detection of meta sequence containers
    • std::list and std::deque are also supported as meta sequence containers
    • Turn operator!= for meta_any into an in-class function
    • All meta node (i.e. meta_data_node, meta_func_node and so on) are no longer static
    • It's now possible to attach multiple properties to a meta object at different times
    • meta_construct also 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_t with poly (deprecated since C++23)
  • process:

    • Added an fwd.hpp file for the submodule
  • resource:

    • Added more comparison operators for resource handles
    • Added type members handle_type and element_type
    • Added member function handle to access the underlying handle
  • signal:

    • Full review of the emitter class
    • dispatcher uses now an std::allocator<void> by default
    • sigh uses now an std::allocator<void> by default
    • Added allocator support to basic_emitter

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) noexcept no matter what
  • Added some utilities test to make all them work also in release mode (see ENTT_DEBUG_TEST and 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:

    • identifier was renamed to ident
    • ident::identifer_type was renamed to ident::value_type
    • family::family_type was renamed to family::value_type
  • entity:

    • Drop the entity/utility.hpp file, use fwd.hpp instead
    • Updated API for basic_registry<...>::group/group_if_exists
    • basic_registry<...>::storage<T> doesn't accept const types anymore
    • storage_traits was renamed to storage_type
    • storage_type::storage_type was renamed to storage_type::type
    • Entity and component type were flipped in the definition of the basic_storage class template
    • Entity and component type were flipped in the definition of the storage_type utility
    • basic_handle<...>::visit was removed, use ::storage instead (iterable model)
    • basic_registry<...>::storage(id) returns a (possibly null) pointer rather than an utterly annoying iterator
  • 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_meta is no longer available (it doesn't fit with context support), use meta_any constructors directly instead
  • resource:

    • Removed resource::use_count, use handle().use_count() instead
  • signal:

    • Full review of the emitter class

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

02 Aug 07:25

Choose a tag to compare

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

01 Aug 08:42

Choose a tag to compare

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

28 Apr 07:28

Choose a tag to compare

Changelog

  • config:

    • Decouple ENTT_NOEXCEPT and exceptions handling
  • 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/erase of 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

15 Apr 12:50

Choose a tag to compare

Changelog

  • config:

    • Added the macro.h file with a couple of utilities
    • Export the ENTT_VERSION string
    • Detect version and configuration mismatches automatically on Windows
  • container:

    • Uses-allocator construction guaranteed for dense_set
    • Uses-allocator construction guaranteed for dense_map
    • dense_map iterators are in the input iterator category but model either a forward (local) or a random (default) iterator
    • dense_map::value_type is either pair<const T &, U &> or pair<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 emplace and insert functions of the dense_map class
    • Strong exception guarantee for emplace and insert functions of the dense_set class
  • 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_deleter and allocate_unique (with uses-allocator construction guaranteed)
    • compressed_pair correctly manages references with piecewise construction
    • ENTT_NOEXCEPT_IF (for future uses)
    • Added an overload of type_id to get a type_info from a variable
    • Allow to construct type_info objects directly (no static storage duration in this case)
  • entity:

    • Optimized runtime view iterators
    • Weak basic_registry<...>::storage for opaque operations across (eventually different) registries
    • basic_runtime_view<...>::iterate/exclude member functions to attach pools at runtime
    • basic_sparse_set<...>::emplace returns an iterator to the inserted element (or the end iterator in case of errors)
    • basic_sparse_set<...>::insert returns an iterator to the inserted elements (or the end iterator in case of errors)
    • sigh_storage_mixin always 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' ::index returns the right index (that is, offset - 1)
    • Internal hook basic_sparse_set<...>::try_emplace was changed to return an iterator to the inserted element (or end())
    • Internal hook basic_sparse_set<...>::try_emplace was changed to accept an additional boolean force_back parameter
    • basic_sparse_set<...>::insert always appends elements rather than trying to fill tombstones if any
    • basic_storage<...>::insert always appends elements rather than trying to fill tombstones if any
    • Internal hook basic_sparse_set<...>::swap_and_pop was changed to accept a couple of iterators
    • Internal hook basic_sparse_set<...>::in_place_pop was canged to accept a couple of iterators
    • basic_sparse_set<...>::clear no 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<...>::bump to force-refresh an entity version
    • Drop component_traits::::ignore_if_empty, use ::page_size 0 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_locator to locator
    • Allocator support when creating new services (see allocate_emplace)
  • meta:

    • meta_type::invoke also 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 scheduler from already running processes
  • resource:

    • Make resource handles equality comparable
    • Removed class resource_loader, made the loader a template parameter of the resource_cache
    • Full review of the resource_cache API and functionalities
    • Full review of the resource_handle (now resource) class
    • Added a transparent resource_loader for basic cases
  • signal:

    • Renamed delegate::instance to delegate::data
    • Added support for named queues to the basic_dispatcher class
    • Enable fetching the number of pending events from a basic_dispatcher
    • Allocator support for the basic_dispatcher class
  • 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<...>::erase when using basic_sparse_set<...>::[const_]iterators
  • 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_map was renamed to dense_map
    • dense_hash_set was renamed to dense_set
  • core:

    • Removed is_iterator_type[_v], no alternative provided
    • Removed ENTT_LAUNDER
  • entity:

    • basic_runtime_views do not have a vector-based constructor anymore, use ::iterate and ::exclude instead
    • basic_registry<...>::runtime_view no longer exists, use the default constructor, then ::iterate and ::exclude
    • Registry context functionalities have been moved to the standalone registry context class and are now part of its API
    • basic_sparse_set<...>::slot is no longer available, no alternative provided
    • basic_sparse_set<...> hooks were slightly changed for performance reasons
    • basic_component_traits doesn't exist anymore, all values should be specified explicitly
    • Renamed basic_registry<...>::sortable to basic_registry<...>::owned
    • component_traits::::ignore_if_empty isn't available anymore, set the page_size to 0 to avoid creating empty types
  • locator:

    • Renamed service_locator to locator
    • Full review of the locator's API (all functions are still there but they've likely a different name)
  • resource:

    • Removed class resource_loader, made the loader a template parameter of the resource_cache
    • Full review of the resource_cache API and functionalities
    • Full review of the resource_handle (now resource) class
  • signal:

    • delegate::instance doesn't exist anymore, use delegate::data instead

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

21 Dec 12:24

Choose a tag to compare

Changelog

  • container:

    • Introduced a new dense_hash_map class that is mostly a drop-in replacement for std::unordered_map.
    • Introduced a new dense_hash_set class that is mostly a drop-in replacement for std::unordered_set.
  • core:

    • Added type_info constructor with in-place type (as in std::in_place_type_t<T>).
    • Added the new class compressed_pair for internal uses but also available to the final user (with support to structured binding).
    • Added is_ebco_eligible[_v] utility.
    • any_cast no longer forces by-copy construction for rvalues.
    • Added enum-as-bitmask support for enum classes.
    • Created a new memory.hpp header to support/offer general purpose functions generally missed in the standard library.
    • Added to_address to unwrap fancy pointers, waiting for C++20.
    • Added propagate_on_container_copy_assignment, propagate_on_container_move_assignment and propagate_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.hpp header 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.
    • constexpr support for type_info.
    • basic_any<...>::type returns the object type if any, type_id<void>() (and not an empty type_info) otherwise.
    • Added optional const type_info & parameter (requested type) to basic_any<...>::data.
    • operator<, operator<=, operator> and operator>= for basic_hashed_string.
    • operator<, operator<=, operator> and operator>= for type_info.
    • type_id returns type_info objects with static storage duration.
    • Added basic_any<...>::assign to copy or move assign the wrapped value without replacing it.
    • Added to_entity and to_version aside to_integral, they forward the request to the right entt_traits<...> class.
    • New input_iterator_pointer utility 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_transparent type member is now part of the identity class.
    • iterable_adaptor utility to create a temporary iterable object from two iterators.
  • entity:

    • Added in_place_delete[_v] and ignore_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_tuple function.
    • Added owned_t besides get_t and exclude_t.
    • Included destroyed list head in the entity count when creating a snapshot.
    • entt_traits is now a first class citizen of the library and all entity related requests rely on it (see ::combine and so on).
    • basic_registry<...>::current returns a tombstone version for invalid entities and doesn't assert anymore.
    • Added basic_sparse_set<...>::current to 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 ::get method to storage for empty types.
    • In-place delete always fills holes before appending new elements during an ::insert.
    • Generalized ::insert for 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<...>::handle to return a const reference to the leading storage.
    • Non-const to const conversion guaranteed for storage iterators.
    • Include fwd.hpp from entity.hpp to make entity available in all cases.
    • Make basic_registry<...>::all_of, basic_registry<...>::any_of and a few other functions remove const qualifiers.
    • Make is_iterator[_v] also support void *and const 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_registry class work smoothly across boundaries.
    • Use a dense hash map to store context variables.
    • Removed the void * custom argument from basic_sparse_set::remove, ::erase, ::emplace, ::insert, ::clear.
    • Added a bind function to the basic_sparse_set to pass the outer context to mixins.
    • Fully removed the poly storage support.
    • Make a const basic_registry fully thread-safe (with placeholder pools).
    • swap is not longer virtual in the basic_sparse_set.
    • Allow emplacing opaque values (void *) from a basic_sparse_set.
    • Allow getting the value type of the derived class from a basic_sparse_set with ::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_entity also work with stable types.
    • Turned basic_component_traits::in_place_delete into a boolean value.
    • Turned basic_component_traits::ignore_if_empty into a boolean value.
    • Added basic_component_traits::page_size to 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_size to allow customizing the sparse page size on a per-type basis.
    • Added basic_group<...>::handle to 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/crend and the const_iterator and const_reverse_iterator type members.
    • basic_storage<...>::each function 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.
  • meta:

    • meta_type::construct doesn't look for base constructors anymore.
    • Container support review (less instantiations, faster to compile).
    • Meta sequence containers ::insert returns now an iterator that is contextually convertible to bool (for validity checks).
    • Meta sequence containers ::erase returns now an iterator that is contextually convertible to bool (for validity checks).
    • meta_arg utility doesn't require an std::index_sequence anymore.
    • The list of types to meta_arg is now a type list template parameter instead of a function parameter.
    • meta_construct utility doesn't require an std::index_sequence anymore.
    • meta_invoke utility doesn't require an std::index_sequence anymore.
    • A public meta_dispatch utility is now available.
    • Removed meta_type::is_void.
    • Add fwd.hpp file for many types in meta.
    • Non-template version of meta_any::allow_cast that works with meta types.
    • Removed parent link from meta objects.
    • Lambda support for meta_invoke and meta_construct utilities.
    • Replaced meta_type::reset with the meta_reset free functions.
    • Added cbegin and cend to meta_range.
    • Added meta_type::is_arithmetic to replace is_integral and is_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::assign to copy or move assign the wrapped value without replacing it.
    • operator-> for meta containers iterators.
    • operator-> for meta_range iterators.
    • 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_range iterators.
    • Extended support to base members when attached to meta types for derived classes.
    • Define meta_associative_container_traits for dense_hash_map.
    • Define meta_associative_container_traits for dense_hash_set.
    • Member functions can be used as meta destructors.
    • Policies also check function return types at compile-time.
    • Added meta_any::owner to know if a meta_any also owns the underlying object.
  • poly:

    • Single function vtable optimization to avoid indirections.
  • resource:

    • Added resource_handle::use_count to k...
Read more

EnTT v3.8.1

28 Jul 08:00

Choose a tag to compare

Changelog

  • core:

    • Make is_equality_comparable[_v] work with iterators that have a non-comparable value_type.
  • entity:

    • Suppress warning for discarding a nodiscard value in the snapshot class.
    • Removed an inconsistent test that fails sporadically.
  • meta:

    • Avoid a risky fallthrough in the meta_any vtable.

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

21 Jul 12:06

Choose a tag to compare

Changelog

  • config:

    • Added error messages to ENTT_ASSERT.
    • Added ENTT_LAUNDER to support older compilers that don't offer std::launder.
    • Replaced ENTT_PAGE_SIZE with ENTT_SPARSE_PAGE and ENTT_PACKED_PAGE.
    • Added ENTT_NOEXCEPTION to fully suppress support for exceptions.
    • ENTT_NO_EXCEPT is automatically defined.
    • Added ENTT_THROW, ENTT_TRY and ENTT_CATCH.
  • core:

    • Refined aggregate support in any to make it closer to its standard counterpart.
    • Added make_any and forward_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] and is_iterator_type[_v].
  • 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 returns entt::null for invalid components.
    • Much faster registry::create for multiple entities (about twice the performance).
    • basic_registry<E>::insert and basic_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 (specializing entt_traits is no longer required).
    • Exception safety for all storage functions is either strong or basic.
    • Added the tombstone_t type and the entt::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 to tombstone_t::operator|).
    • Added component_traits (see component.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 and view_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>::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] or T[N][M]) aren't treated as pointer-like types.
    • Added make_meta and forward_as_meta functions.
    • Drastically reduced the number of instantiations/size of vtables due to meta_any.
  • resource:

    • Added a bunch of conversion functions to resource_handle.
  • 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 when other isn't copyable.

Deprecated feature

  • core:

    • Deprecated std::reference_wrapper support: use std::in_place_type<T &>, use make_any or ::emplace<T &> instead.
  • 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: use std::in_place_type<T &>, use make_meta or ::emplace<T &> instead.

Breaking changes

  • config:

    • ENTT_ASSERT now receives two arguments (condition and error message).
    • Removed ENTT_PAGE_SIZE, use ENTT_SPARSE_PAGE and ENTT_PACKED_PAGE instead.
    • Defining ENTT_NO_EXCEPT triggers an error, use ENTT_NO_EXCEPTION to fully disable exceptions instead.
  • core:

    • Removed entt::is_empty[_v] and ENTT_IS_EMPTY, no longer required/supported.
  • entity

    • view::raw and group::raw return now a paged array of components (for pointer stability).
    • basic_registry<E>::insert and basic_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).
  • process:

    • process::dead has been renamed to process::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

14 Apr 13:34

Choose a tag to compare

Changelog

  • core:

    • Extended support to both aggregates and non-aggregates type for any.
    • No more redundant copies in any when emplacing (as in .emplace<T>(args...)).
    • No more redundant copies in any when emplacing (as in = value).
    • No more redundant copies in any when resetting (as in .reset()).
  • 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.
  • meta:

    • Extended support to both aggregates and non-aggregates type for meta_any.
    • No more redundant copies in meta_any when emplacing (as in .emplace<T>(args...)).
    • No more redundant copies in meta_any when emplacing (as in = value).
    • No more redundant copies in meta_any when resetting (as in .reset()).
    • Reduced instantiations due to meta_prop.

Bug fixes

None

Breaking changes

  • core:
    • Removed trait is_std_hashable[_v].

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

02 Apr 09:06

Choose a tag to compare

Changelog

  • core:
    • Added support for non-copyable types to any.
    • Standard containers friendly is_equality_comparable trait.
    • Added type_list_diff[_t] trait.
    • Added any::reset().
    • Copying an any always 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_ref is a member function rather than an in-class friend function exported in the global namespace.
    • basic_any supports configurable sbo size, any is an alias for basic_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_any takes now in consideration implicit alignment requirements for in_situ tests.
    • Added an extra parameter to basic_any to specify desired alignment requirements for the SBO storage.
  • entity:
    • Avoid UB with sparse_set::clear and component-less registry::clear.
    • Use entt::any to store context variables in a registry.
    • registry::storage returns actual references (eventually const) to the poly storage objects.
    • Added basic_sparse_set<E>::at to get entities at given positions.
    • Stable virtual remove for sparse sets.
    • Poly storage no longer has a remove member function by default.
    • Faster registry::clear that delegates to pools.
    • Added optional user data to basic_sparse_set<E>::remove and basic_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.
  • meta:
    • Implicitly generated default meta constructors for default constructible types.
    • Pointer-like to void support (dereference to invalid meta_any).
    • All overloads of meta_type::base return instances of meta_type now.
    • User defined getters are detected as are data members (is_invocable<F, [const] T &> instead of is_invocable<F, [const] T *>).
    • as_ref_t adapts to the constness of the underlying object/return type, as_cref_t always returns by const reference.
    • Added meta_any::reset().
    • Internal utilities (like meta_function_descriptor and meta_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_any when used as pointer-like types.
    • Added explicit const meta_handle::operator bool().
    • Copying a meta_any always 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 example is_template_specialization).
    • meta_any::operator== is now consistent across boundaries.
    • meta_any::as_ref is 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_prop key is now returned by const reference rather than by copy.
    • Removed has_meta_sequence_container_traits[_v] and has_meta_associative_container_traits[_v].
    • Meta destructors are no longer invoked for non-owning meta_any objects.
  • resource:
    • Removed the requirement for shared_ptr<T> from the loader/cache.
  • poly:
    • Added poly::reset().
    • Copying a poly always returns a copy of the contained object, even in case of references to external elements.
    • poly<T>::as_ref is a member function rather than an in-class friend function exported in the global namespace.
    • poly supports configurable sbo size with a default of sizeof(double[2]).
    • Added an extra parameter to poly to specify desired alignment requirements for the underlying storage.
  • signal:
    • Made dispatcher class work fine with std::is_copy_constructible.
  • Build system:
    • Updated Bazel configuration.
    • Added pkg-config support upon installation.
    • Use lcov for code coverage on the CI.

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.

Breaking changes

  • core:
    • In-place construction of references in any requires the argument to be an actual lvalue reference and not a pointer.
    • Copying an any always returns a copy of the contained object, even in case of references to external elements. Move the any object, pass it by reference or use as_ref to propagate elements without copying them.
    • Free function as_ref no longer exists for any, use any::as_ref() instead.
    • ENTT_PAGE_SIZE sets the number of elements of a page, not the size in bytes.
  • entity:
    • Removed registry::raw<T>(), use registry.view<T>().raw() instead.
    • Removed registry::data<T>(), use registry.view<T>().data() instead.
    • Updated precondition of registry::assign (all pools empty -> no entities still alive).
    • Renamed registry::has<T...> to registry::all_of<T...> and registry::any<T...> to registry::any_of<T...>.
    • Renamed handle::has<T...> to handle::all_of<T...> and handle::any<T...> to handle::any_of<T...>.
    • registry::storage returns poly storage objects by reference rather than by copy. Capture them by reference before using.
    • Poly storage no longer has a remove member function by default.
    • Const registry::view is no longer thread safe.
  • meta:
    • Removed meta_conv, it's used internally when needed (eg meta_any::allow_cast).
    • Removed meta_base, it's used internally when needed (eg meta_any::cast).
    • All overloads of meta_type::base return instances of meta_type now.
    • 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_any always returns a copy of the contained object, even in case of references to external elements. Move the meta_any object, pass it by reference or use as_ref to propagate elements without copying them.
    • Renamed meta_ctor::size and meta_func::size to meta_ctor::arity and meta_func::arity.
    • Deleted meta_handle copy constructor. No alternatives provided. Meta handles should never be copied.
    • Free function as_ref no longer exists for meta_any, use meta_any::as_ref() instead.
    • Removed has_meta_sequence_container_traits[_v] , use entt::is_complete_v<entt::meta_sequence_container_traits<T>> instead.
    • Removed has_meta_associative_container_traits[_v], use entt::is_complete_v<entt::meta_sequence_associative_traits<T>> instead.
  • poly:
    • Copying a poly always returns a copy of the contained object, even in case of references to external elements. Move the poly object, pass it by reference or use as_ref to propagate elements without copying them.
    • Free function as_ref no longer exists for poly<T>, use poly<T>::as_ref() instead.

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.