Skip to content

EnTT v3.7.0

Compare
Choose a tag to compare
@skypjack skypjack released this 02 Apr 09:06
· 3721 commits to master since this release

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.