C++ Object Token Library
— это эволюция Unified Pointer Library из этой темы
The C++ Object Token Library (CppOtl) provides a set of tokens that are
designed to manage an object's lifetime, similar to smart pointers from the
C++ standard library. CppOtl contains tokens for unique and shared
ownership of objects, weak observers for them, adds a unified type of
ownership. Also, it introduces tokens with single (not_null) multiplicity,
which can mitigate the "null references: billion-dollar mistake".
Tokens from CppOtl are integrated with smart pointers from the C++ standard
library and can be consistently converted from one to another. CppOtl is
intended for cases when there is not enough functionality of smart pointers
from the C++ standard library and additional capabilities are required.
1. A set of consistent tokens that can express associative links, function
parameters and variables according to a UML model.
2. `single` tokens that always have a linked object and can not be empty.
3. `trackable` and `untrackable` tokens for appropriate use-case
4. The `safe::weak` can be created both from the `safe::unique` and the
`safe::shared`. It will become `expired` (but not `dangling`) when an owner
of a watched object is destroyed.
5. The `safe::unified` can temporarily prolong an object's lifetime in a
given scope that allows finishing work with an object even other tokens is
6. A constructor with the `itself` parameter allows a token itself to
create an object with given attributes.
7. Algorithms for unified access to object tokens.
8. Tokens meet the requirements of `std::ranges::range`, that allows to
pass them to functions that accept `range` argument.
9. Traits allow recognizing characteristics of tokens in compile-time.
10. Focusing on maximum error detection in compile-time, several assertions
in a debug build, minimum overhead in a release build, avoiding exceptions.
11. The ability to create other token classes with required