v0.6.0
Main changes / breaking changes:
- Added
basic_observable_ptr,basic_observer_ptr,basic_enable_observer_from_thisand policies to fine tune their behavior and API. observable_unique_ptr,observable_sealed_ptr,observer_ptrare 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_thishas been removed and is now replaced byenable_observer_from_this_unique(forobservable_unique_ptrowners) andenable_observer_from_this_sealed(forobservable_sealed_ptrowners). enable_observer_from_this_uniquepreserves 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_uniqueallocates, and thus cannot benoexcept.enable_observer_from_this_sealedrequires the objectTto 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.