Releases: cschreib/observable_unique_ptr
Releases · cschreib/observable_unique_ptr
v0.7.2
Small changes and bug fixes:
- The explicit casting constructor of
oup::basic_observable_ptr
would not move the deleter. This is now fixed. - A call to
oup::dynamic_pointer_cast
on a null pointer would not move the deleter. This is now fixed. - MSVC would report a false positive warning about a
noexcept
function that can throw. The warning is now silenced. - Improved error message for over-aligned types in
oup::make_observable
. - (internal only) Improved encapsulation of the
ptr_and_deleter
object. - (internal only) Refactored the tests and increased coverage; using snitch instead of Catch2.
v0.7.1
Small changes and bug fixes:
- Fixed
enable_observer_from_this*
with policies that do not guarantee the existence of a block (i.e., custom policies that are not the defaultunique
orsealed
). - Fixed leaks for non-sealed pointers, when allocation of the control block fails in the constructor or in
reset()
. - Fixed
make_observable*()
not aware of alignment constraints. - Added early
static_assert
to catch misuse and generate clearer error messages. - Various typos fixed, and documentation improved.
v0.7.0
v0.6.1
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.
v0.5.2
v0.5.1
v0.5.0
Main changes:
- Added explicit casting constructors to
observer_ptr
. - Added
static_pointer_cast
,const_pointer_cast
, anddynamic_pointer_cast
for all pointer types.
Small changes and bugfixes:
- Fixed explicit casting constructors for owner pointers leaking the control block when given a null pointer
- Fixed explicit casting constructor for sealed pointers forcing a
T*
as input, rather preserving the user's pointer type throughout. In theory this could have brokenenable_observer_from_this
in some edge cases (T*
not inheriting fromenable_observer_from_this
, but user-suppliedV*
does). However in practice, the raw pointer must come from a sealed pointer, and will therefore already have its control block setup correctly. So this has no observable consequence.
v0.4.1
Small changes and bug fixes:
- Fixed
observable_unique_ptr::reset(T*)
incorrectly marked noexcept. - Fixed
enable_observable_from_this
not supporting multiple inheritance, or storage in base-class owner pointer. - Decreased memory usage of
enable_observable_from_this
. - Added explicit checks against
T[]
since arrays are not supported. - Fixed documentation errors