v0.6.0
Main changes / breaking changes:
- Added
basic_observable_ptr
,basic_observer_ptr
,basic_enable_observer_from_this
and policies to fine tune their behavior and API. observable_unique_ptr
,observable_sealed_ptr
,observer_ptr
are now defined as aliases to the above types with pre-configured policies, which are expected to be the most user-friendly / useful policies. But other choices of custom policies are viable and allowed.- Breaking:
enable_observer_from_this
has been removed and is now replaced byenable_observer_from_this_unique
(forobservable_unique_ptr
owners) andenable_observer_from_this_sealed
(forobservable_sealed_ptr
owners). enable_observer_from_this_unique
preserves the same API and behavior as the now defunctenable_observer_from_this
, with the added benefit that callingobserver_from_this()
in constructors will return a valid, non-null pointer. The function is now guaranteed to always return a valid pointer, and is thusnoexcept
. However, the constructor ofenable_observer_from_this_unique
allocates, and thus cannot benoexcept
.enable_observer_from_this_sealed
requires the objectT
to take a control block as first argument of its constructor, to be forwarded toenable_observer_from_this_sealed
. This enables callingobserver_from_this()
in the constructor. The function is now guaranteed to always return a valid pointer, and is thusnoexcept
.- The memory footprint of the control block has been optimised.
Small changes and bug fixes:
- Improvements to the documentation.
- Added more compile-time tests.