Skip to content

EnTT v3.12.0

Compare
Choose a tag to compare
@skypjack skypjack released this 15 Jun 09:49
· 1611 commits to master since this release

Changelog

  • config:

    • ENTT_FAIL(msg) as an alias of ENTT_ASSERT(false, msg)
  • core:

    • is_equality_comparable also detects C-style arrays
    • Added value_list_index[_v], value_list_unique[_t], value_list_contains[_v] and value_list_diff[_t]
    • std::tuple traits specialization for entt::type_list and entt::value_list
  • entity:

    • All group types are copyable and movable
    • View filter storage classes are now available (see ::storage)
    • Group filter storage classes are now available (see ::storage)
    • Propagate the allocator to the registry context
    • sigh_helper utility to simplify connecting multiple listeners to a registry
    • Public basic_sparse_set<...>::traits_type type member
    • Public basic_storage<...>::traits_type type member
    • Public basic_registry<...>::traits_type type member
    • component_traits treat void properly as any other component type
    • Split entt_traits and basic_entt_traits to simplify specializing the former
    • Make entity_mask and version_mask available through entt_traits
    • Add entt_traits::base_type for the final user (not used internally)
    • Make basic_registry work properly with void component type
    • Handles discard their entities on destruction
    • Improved removing/erasing elements when a sigh_mixin is attached to a storage
    • Added internal, opaque data function to sparse set iterators
    • Additional internal virtual clear_all function available in the basic_sparse_set<...> class
    • Improved performance of sparse set remove, erase and clear functions
    • Improved performance of registry remove, erase, clear and destroy functions
    • deletion_policy is now publicly available via entity/fwd.hpp
    • Added basic_sparse_set<...>::contiguous function
    • extended_storage_iterator::base makes the underlying iterator available
    • extended_view_iterator::base makes the underlying iterator available
    • extended_group_iterator::base makes the underlying iterator available
    • Added a specialization of basic_storage when the value type is also the entity type (entity storage)
    • Entities have their own storage in a registry and it's accessible as storage<entity_type>()
    • Sigh mixin also supports entity storage types (to send signals on entity creation/destruction/update)
    • Exclude-only like views are also supported because of the entity storage
    • added basic_entt_traits::next returns the next valid version of an identifier
    • Refined transparent aggregate support for storage types
    • Deprecated the following functions in the registry class:
      • basic_registry<...>::size() (use .storage<E>().size() instead)
      • basic_registry<...>::alive() (use .storage<E>().in_use() instead)
      • basic_registry<...>::reserve(cap) (use .storage<E>().reserve(cap) instead)
      • basic_registry<...>::capacity() (use .storage<E>().capacity() instead)
      • basic_registry<...>::empty() (use .storage<E>().in_use() instead)
      • basic_registry<...>::data() (use .storage<E>().data() instead)
      • basic_registry<...>::released() (use .storage<E>().in_use() and .storage<E>().size() instead)
      • basic_registry<...>::release(args...) (use .storage<E>().erase(args) and .storage<E>().bump(entt) instead)
      • basic_registry<...>::assign(args...) (use .storage<Entity>().push(first, last) and .storage<Entity>().in_use(len) instead)
      • basic_registry<...>::each(args...) (use .storage<Entity>().each() instead)
    • basic_sparse_set<...>::bump returns the version in use
    • basic_storage<...>::insert returns an iterator to the range of inserted elements
    • Storage based groups fully support multiple storage of the same type now
    • Huge internal rework to reduce the dependencies between the registry and the group classes/handlers
    • All group types have a .handle() function to return a reference to the leading storage
    • basic_registry<...>::group is no longer [[nodiscard]]
    • Configurable mask type for basic_observer
    • Allocator support for basic_observer
    • get_t, owned_t and exclude_t are (constexpr constructible) types now rather than aliases of type_list
    • basic_storage uses allocator_traits::destroy now rather than std::destroy_at (to allow specializations if needed)
    • Make basic_registry<...>::storage_for_type<...> available to the final user
    • basic_view<..>::operator bool returns true only for fully initialized views
    • Uninitialized views behave correctly in all circumstances, returning the expected result on each call
    • Views support swapping their storage or setting them lazily
    • View packs fully support empty views finally
    • basic_registry<...> doesn't instantiate temporary static storage on const function anymore
    • on_construct/on_update/on_destroy of basic_registry<...> also support named pools
    • Added a reverse each function (reach, worst name ever) to all storage classes
    • basic_registry<...>::erase_if to conditionally erase elements from their storage
    • Deprecated the following functions in the snapshot classes:
      • entities() (use get<Entity>() instead)
      • component<...>(...) (use get<T>(...) instead)
      • shrink, no longer required
    • General purpose ::get<T>(...) function for snapshot classes that works with storage types
    • Runtime pools support for snapshot classes (see ::get<T>(...) for further details)
    • Drop multi-type archive function requirement for snapshot classes
  • graph:

    • Allocator type propagates to the graph type returned by flow::graph() calls
  • locator:

    • Support for opaque structures
  • meta:

    • It's now possible to update the value of a meta property at any time (non-const meta_any ref)
    • Full support to meta member functions for primitive types
    • operator==/!= for meta_handle
    • operator==/!= for meta_data
    • operator==/!= for meta_prop
    • operator==/!= for meta_func
  • process:

    • Introduced basic_scheduler with default delta type for common cases
    • Turn scheduler into an alias for basic_scheduler<std::uint32_t>
  • signal:

    • Added delegate::target to get a pointer to the stored callable function
    • Refined transparent aggregate support for the dispatcher class
    • delegate also supports functions that skip first elements (on second attempt only)
    • Allow disconnecting listeners during iterations over the sigh class

Build system

  • Bump IWYU version to 0.19
  • Bump CMake version to 3.15.7
  • Enable documentation diagnostic for Clang
  • Increase CI warning level to /W1 on Windows
  • Add GCC11 to the list of compilers directly checked by the CI

Any other business

  • Suppress a few warnings due to unused variables in corner cases
  • More [[nodiscard]] where it makes sense (i.e. any_cast or meta_type::from_void)
  • Better allocator support with additional runtime checks for corner cases

Natvis support

All natvis files have been updated where necessary.

Breaking changes

  • entity:

    • ignore_as_empty_v doesn't exist anymore, use component_traits<...>::page_size instead
    • entt_traits::reserved is no longer available, combine entity_mask and version_mask instead
    • basic_sparse_set<...>::swap_at is now a protected function, override swap_or_move as needed instead
    • basic_sparse_set<...>::move_element doesn't exist anymore, use swap_or_move instead (with checks on to if needed)
    • sigh_storage_mixin was renamed into sigh_mixin
    • basic_sparse_set<...>::emplace was renamed to push
    • basic_sparse_set<...>::insert was renamed to push
    • basic_sparse_set<...>::get was renamed to value
    • basic_sparse_set<...>::sort was renamed to sort_as
    • basic_group<...>::sort (no callback overload) was renamed to sort_as
    • basic_registry<...>::base_type was renamed to common_type
    • basic_group<...>::base_type was renamed to common_type
    • runtime_view<...>::base_type was renamed to common_type
    • basic_view<...>::base_type was renamed to common_type
    • Nested groups are no longer supported (the pain is not worth the gain)
    • basic_view<...>::storage<...>() returns a (possibly null) pointer rather than a reference
    • basic_view<...>::handle() returns a (possibly null) pointer rather than a reference
    • basic_group<...>::storage<...>() returns a (possibly null) pointer rather than a reference
    • basic_view<...>::refresh() is a self-contained, non-const function that changes the view in-place
    • basic_view<...>::use<T>() is a self-contained, non-const function that changes the view in-place
  • process:

    • scheduler no longer requires a template parameter, use basic_scheduler if std::uint32_t isn't a good enough delta type
  • signal:

    • disconnect by reference is no longer available on the sink class, use the overload that accepts a pointer instead
    • sink<...>::before is no longer supported, no alternative provided

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.