Skip to content

Releases: cschreib/observable_unique_ptr

v0.7.2

16 Oct 19:50
3b90166
Compare
Choose a tag to compare

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

20 Sep 16:38
c82b3cd
Compare
Choose a tag to compare

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 default unique or sealed).
  • 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

06 Jul 07:57
57c0bb0
Compare
Choose a tag to compare

Main changes:

  • Added a casting constructor from owner pointer to basic_observer_ptr (#12).

Small changes and bug fixes:

  • Fixed documentation error for basic_observer_ptr constructors.

v0.6.1

14 Apr 07:07
08f687f
Compare
Choose a tag to compare

Small changes and bug fixes:

  • Fixed "extra semicolon" warning
  • Fixed "shift sign overflow" warning and "sign conversion" warning
  • Fixed inconsistent line endings in the repository
  • Setup and run clang-format for consistent formatting

v0.6.0

07 Jan 17:14
1053747
Compare
Choose a tag to compare

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.

v0.5.2

26 Dec 11:30
Compare
Choose a tag to compare

Small changes and bug fixes:

  • Silence an unused-variable warning
  • Fix CI failure for WebAssembly

v0.5.1

21 Nov 09:36
Compare
Choose a tag to compare

Small changes and bug fixes:

  • Fixed operator bool() not marked const.
  • Fixed compiler error with conversion operator= for owner pointers.

v0.5.0

13 Nov 17:43
fe5491b
Compare
Choose a tag to compare

Main changes:

  • Added explicit casting constructors to observer_ptr.
  • Added static_pointer_cast, const_pointer_cast, and dynamic_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 broken enable_observer_from_this in some edge cases (T* not inheriting from enable_observer_from_this, but user-supplied V* 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

13 Nov 14:00
a1c175e
Compare
Choose a tag to compare

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

v0.4.0

11 Nov 19:47
b697b94
Compare
Choose a tag to compare

Main changes:

  • Added enable_observer_from_this.
  • Fixed operator=(const T&) and swap(T&) not handling self-assignment and self-swap correctly.
  • Fixed mismatched new[]/delete warnings in valgrind.

Small changes and bug fixes:

  • Added code coverage tests.