v0.3.0
Main changes:
observable_unique_ptrwill now optimize memory usage for empty (stateless) deleters for all versions of C++, not just C++20.observable_unique_ptrhas been split intoobservable_unique_ptrandobservable_sealed_ptr. The former preserves the original API, except that allocation optimisation inmake_observable_unique()has been disabled (it prevents writing a saferelease()function). The latter has the same API except it is missingvoid reset(T*)andT* release(); once a raw pointer is acquired, it is "sealed" inside the smart pointer. This enables the allocation optimisation inmake_observable_sealed(). You can choose between the two pointers depending on your needs:- need to be able to
release()? useobservable_unique_ptr. - do not need to be able to
release()? useobservable_sealed_ptr(reset(T*)can be replaced by assignment).
- need to be able to
- Added tests and official support for WebAssembly / Emscripten.
Small changes and bug fixes:
- Fixed
observer_ptrnot assignable fromobservable_unique_ptrwith a custom deleter, and not assignable from other observer pointer of same type. - Fixed
release()not flagging theobservable_unique_ptras expired for observers. - Fixed control block allocated and not freed when constructing
observable_unique_ptrwith aT*equal tonullptr(but not directlynullptr). - Fixed
release()from amake_observable_unique()pointer leaving observer pointer with a dangling control block when the user deletes the released pointer. - Added speed benchmarks.