EnTT v3.7.0
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 forbasic_any<sizeof(double[2])>
.- Added eventually constexpr conversion operator to underlying type to
type_seq
. - Added eventually constexpr conversion operator to underlying type to
type_hash
. - Added eventually constexpr conversion operator to underlying type to
type_name
. basic_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.
- Added support for non-copyable types to
entity
:- Avoid UB with
sparse_set::clear
and component-lessregistry::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
andbasic_sparse_set<E>::clear
. - Simplified
sigh_storage_mixin
, less instantiations, less code, same functionalities. - Added unchecked
basic_sparse_set<E>::operator[](pos)
. - Added support to aliased context variables (externally managed objects attached to a registry by reference).
- Added an
operator|
to views for piping that creates a new view rather than a view pack. - Non-allocating non-const
registry::try_get
.
- Avoid UB with
meta
:- Implicitly generated default meta constructors for default constructible types.
- Pointer-like to
void
support (dereference to invalidmeta_any
). - All overloads of
meta_type::base
return instances ofmeta_type
now. - User defined getters are detected as are data members (
is_invocable<F, [const] T &>
instead ofis_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
andmeta_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 exampleis_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]
andhas_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.
- Removed the requirement for
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 ofsizeof(double[2])
.- Added an extra parameter to
poly
to specify desired alignment requirements for the underlying storage.
- Added
signal
:- Made
dispatcher
class work fine withstd::is_copy_constructible
.
- Made
- Build system:
- Updated
Bazel
configuration. - Added
pkg-config
support upon installation. - Use
lcov
for code coverage on the CI.
- Updated
Bug fixes
entity
:- Fixed an issue with
registry::clear
. There are two ways to get around it in v3.6.x:registry.each([&](auto entity) { registry.destroy(entity); });
if interested in signals.registry = {};
if not interested in signals.
- Fixed an issue with
Breaking changes
core
:- In-place construction of references in
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 theany
object, pass it by reference or useas_ref
to propagate elements without copying them. - Free function
as_ref
no longer exists forany
, useany::as_ref()
instead. ENTT_PAGE_SIZE
sets the number of elements of a page, not the size in bytes.
- In-place construction of references in
entity
:- Removed
registry::raw<T>()
, useregistry.view<T>().raw()
instead. - Removed
registry::data<T>()
, useregistry.view<T>().data()
instead. - Updated precondition of
registry::assign
(all pools empty -> no entities still alive). - Renamed
registry::has<T...>
toregistry::all_of<T...>
andregistry::any<T...>
toregistry::any_of<T...>
. - Renamed
handle::has<T...>
tohandle::all_of<T...>
andhandle::any<T...>
tohandle::any_of<T...>
. registry::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.
- Removed
meta
:- Removed
meta_conv
, it's used internally when needed (egmeta_any::allow_cast
). - Removed
meta_base
, it's used internally when needed (egmeta_any::cast
). - All overloads of
meta_type::base
return instances ofmeta_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 themeta_any
object, pass it by reference or useas_ref
to propagate elements without copying them. - Renamed
meta_ctor::size
andmeta_func::size
tometa_ctor::arity
andmeta_func::arity
. - Deleted
meta_handle
copy constructor. No alternatives provided. Meta handles should never be copied. - Free function
as_ref
no longer exists formeta_any
, usemeta_any::as_ref()
instead. - Removed
has_meta_sequence_container_traits[_v]
, useentt::is_complete_v<entt::meta_sequence_container_traits<T>>
instead. - Removed
has_meta_associative_container_traits[_v]
, useentt::is_complete_v<entt::meta_sequence_associative_traits<T>>
instead.
- Removed
poly
:- Copying a
poly
always returns a copy of the contained object, even in case of references to external elements. Move thepoly
object, pass it by reference or useas_ref
to propagate elements without copying them. - Free function
as_ref
no longer exists forpoly<T>
, usepoly<T>::as_ref()
instead.
- Copying a
Any other business
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the section EnTT
in Action with more and more examples.
I started a long term process to reduce the number of instantiations and therefore speed up the compilation.
This release contains some more changes in this regard. Still a work in progress though.