Skip to content

Releases: skypjack/entt

EnTT v3.10.2

01 Aug 08:42
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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.

EnTT v3.6.0

09 Jan 16:13
Compare
Choose a tag to compare

Changelog

Short version (aka most wanted/relevant changes)

  • Stamp is back. 😄
  • Truly const and therefore const thread safe registry.
  • meta_any as well as the new any class support const references.
  • I've added the organizer class to create a minimal dependency graph for your systems.
  • The EnTT type system was improved and type_info is now an opaque type returnd by type_id<T>.
  • There is a new module called poly for automated static polymorphism.
  • Full support for custom pools is finally a (very important) thing.

Long version (aka all you can find in v3.6.0)

  • config:

    • Reintroduced ENTT_DISABLE_ASSERT to fully disable asserts.
  • core:

    • Added sfinae-friendly class type_seq to provide sequential identifiers for types.
    • Added sfinae-friendly class type_hash to provide unique identifiers for types.
    • Added sfinae-friendly class type_name to provide demangled names for types.
    • Added untyped class type_info as a replacement for the template class type_info<T>.
    • Added type_id function template to generate untyped type_info objects from types:
      auto info = entt::type_id<a_type>();
      
    • Added utility type_list_contains[_v].
    • Added size_of_v, an extension for sizeof that doesn't complain when used with functions or incomplete types.
    • Added type_list<T...>::size to know the number of types of a type list.
    • Added operator+ for type lists (similar to type_list_cat[_t], but for variables rather than types):
      constexpr auto list = entt::type_list<int, char>{} + entt::type_list<double>{};
      
    • Added traits is_applicable[_v] and is_applicable_r[_v], a sort of std::is_invocable with tuples.
    • Added trait is_empty[_v] (mainly used for internal purposes) that is true only if ENTT_NO_ETO isn't defined.
    • Updated default page size (ENTT_PAGE_SIZE) to 4096.
    • hashed_string::value is now constexpr, suitable for uses with string views in constant expressions.
    • Added trait constness_as[_t] to transfer the constness between types.
    • User defined literals for hashed strings (_hs and _hws) have been moved to the namespace entt::literals.
    • Added trait is_complete[_v] to detect complete types.
    • Standalone, branchless implementation of entt::any with a default SBO size of sizeof(double[2]).
    • entt::any support for both const and non-const references (extended to meta and poly, see below).
    • Added entt::any_cast overloads similar to what the standard library offers.
    • Added as_ref to create aliases to unmanaged objects with any.
    • Added value_list and value_list_cat[_t] (similar to type_list and type_list_cast[_t], but for values rather than types).
    • Added type_identity[_t] trait (waiting for a C++20 version of EnTT).
    • Added type_list_element[_t] for type_lists, similar to std::tuple_element_t.
    • Added value_list_element[_v] for value_lists, similar to std::tuple_element_t.
  • entity:

    • Full support for custom storage/views (🥳). This is HUGE, even if at the moment it lacks proper documentation.
    • storage_adapter_mixin and sigh_pool_mixin are now independent from each other. It's also easy to set a signal-less default pool:
      template<typename Entity, typename Type>
      struct pool<Entity, Type> {
          using type = storage_adapter_mixin<basic_storage<Entity, Type>>;
      };
      
    • Added multi-type view ::size_hint member function.
    • registry::visit and registry::ctx return now a whole type_info object rather than the sole identifier.
    • It's now possible to create truly invalid instances of entt::handle.
    • Added the new class organizer to create a minimal dependency graph for your systems, see the documentation for further details.
    • storage::emplace returns now the newly created object.
    • Introduced the alias value_type as a replacement for object_type (storage, pool).
    • Added basic_group<...>::each() and basic_view<...>::each() as a replacement for ::proxy.
    • Reduced scope for candidate selection in views.
    • Extended get for views and groups:
      auto [pos, vel] = registry.view<position, velocity>().get(entity);
      
    • Added the view_pack class template to combine views and decide what type leads the iteration:
      for(auto entity: registry.view<position>() | registry.view<velocity>()) {
          // ...
      }
      
      The intended use for this tool is with custom storage/views, but it's also useful in everyday uses.
      The view pack is a view-like object, similar to a multi-type view. It's also iterable and it offers both each(func) and each() as well:
      for(auto [entity, pos, vel]: (registry.view<position>() | registry.view<velocity>()).each()) {
         // ...
      }
      
      A view pack converts to references to its views. See the documentation for further details.
    • Callbacks with entity are now the first choice for views and groups.
    • Iterable views and groups (each()) also offer reverse iterators.
    • registry::assign also requires the head of the list of destroyed entities now and is much (much!) faster.
    • Added registry::destroyed to get the head of the list of destroyed entities (to use with ::raw and ::assign).
    • Added view<...>::use<T> to multi-type views to force the pool to use a given storage (useful when using iterators).
    • Added the handle_view class, a more restricted version of handle which also specifies the types it operates on (conversion operators available).
    • Relaxed the requirement to expose a try_get member functions for (custom) storage classes.
    • Added the entt::get_as_tuple function to get the content of a storage given an entity as a (possibly empty) tuple.
    • Added the sfinae-friendly storage_traits class to provide information on storage classes.
    • Views constructors are public now, it's possible to create views from custom or externally managed storage.
    • Added runtime view ::size_hint member function.
    • Default constructible, invalid (pool-less) groups, views and runtime views.
    • Truly const and therefore const thread safe registry (currently based on pool-less views).
    • Support for destroying entities from a handle (namely basic_handle<Entity>::destroy).
    • Added poly_storage, fully customizable poly_storage_traits and const/non-const registry::storage for opaque proxies to pools (aka welcome back stamp, copy, ...). 🙂
    • Added registry::reserve_pools to reserve enough storage for pools when needed.
  • meta:

    • Added opaque meta_type::size_of to know the size of the underlying type.
    • Added meta_type::info as a replacement for meta_type::hash.
    • Extended resolve, it accepts now a type as a template parameter, or an unique identifier or type info object as an argument.
    • Meta functions and meta constructors finally support external functions:
      entt::meta<Type>().type("Type"_hs).func<&entt::registry::emplace_or_replace<Type>, entt::as_ref_t>("emplace"_hs);
      
    • Added meta function overload support.
    • Container traits are no longer an internal details only.
    • A meta_any that doesn't contain a pointer-like object can be safely dereferenced and will return an invalid instance.
    • meta_any uses entt::any internally rather than meta_storage.
    • Reduced instantiations due to meta_any using a single fake vtable function internally.
    • Added as_ref to create aliases to unmanaged objects with meta_any.
    • Support for const references when working with aliased objects.
    • Added the as_cref_t policy to receive data members and return values as const references.
    • Pointer-like types to const elements return wrapped const references rather than making a copy of the pointed object.
    • Meta containers support for const containers, their const iterators and const references to their elements.
    • Added meta_any::allow_cast as a better, more flexible alternative for meta_any::convert.
    • Added const and non-const overloads of meta_any::get and meta_any::invoke.
    • Direct alias constructor for meta_any:
      int value = 42;
      entt::meta_any any{std::in_place_type<int>, &value};
    • Added const and non-const overloads for operator*, as_sequence_container and as_associative_container to meta_any.
    • Support for pointer-like types with a custom dereference operator other than operator*.
  • poly:

    • Added a new module called poly for automated static polymorphism.
      See the official documentation for all the details and usage instructions.
  • signal:

    • Truly const and therefore const thread safe emitter.
  • The single include file also contains the version now.

  • Allow compilation for Windows with GNU-like compilers.

  • Performance improvements here and there (registry::create, registry::clear, storage remove and range-remove, ...).

Breaking changes

  • config

    • ENTT_STANDALONE has been removed.
    • ENTT_HS_SUFFIX has been removed.
    • ENTT_HWS_SUFFIX has been removed.
  • core:

    • type_index has been removed, use type_seq instead.
    • has_type_index[_v] utility has been removed.
    • type_info is not longer a class template. See the untyped version of type_info, the type_id function template, other than type_seq, type_hash and type_name for further details.
    • Removed type_list_size[_v], use type_list<T...>::size instead.
    • is_eto_eligible[_v] is now is_empty[_v].
      ...
Read more

EnTT v3.5.2

22 Sep 06:31
Compare
Choose a tag to compare

Changelog:

  • meta:
    • Implemented shortcuts for meta-functions and meta-data (see meta_any and meta_type).
    • meta_any support for pointer-like types to non-const, non-copyable types.

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.