Skip to content

v0.6.0

Compare
Choose a tag to compare
@cschreib cschreib released this 07 Jan 17:14
· 172 commits to main since this release
1053747

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 by enable_observer_from_this_unique (for observable_unique_ptr owners) and enable_observer_from_this_sealed (for observable_sealed_ptr owners).
  • enable_observer_from_this_unique preserves the same API and behavior as the now defunct enable_observer_from_this, with the added benefit that calling observer_from_this() in constructors will return a valid, non-null pointer. The function is now guaranteed to always return a valid pointer, and is thus noexcept. However, the constructor of enable_observer_from_this_unique allocates, and thus cannot be noexcept.
  • enable_observer_from_this_sealed requires the object T to take a control block as first argument of its constructor, to be forwarded to enable_observer_from_this_sealed. This enables calling observer_from_this() in the constructor. The function is now guaranteed to always return a valid pointer, and is thus noexcept.
  • The memory footprint of the control block has been optimised.

Small changes and bug fixes:

  • Improvements to the documentation.
  • Added more compile-time tests.