There is a note about the semantics of owner
further down the page:
Note owner<T*>
has no default semantics beyond T*
. It can be used without changing any code using it and without affecting ABIs. It is simply a indicator to programmers and analysis tools. For example, if an owner<T*>
is a member of a class, that class better have a destructor that delete
s it.
It's basically the almost same as the proposed std::observer_ptr
. The difference is that owner
stores a pointer and "owns" it, although it doesn't do any RAII like std::unique_ptr
. It should be used when you want to be more explicit that a raw pointer is a owning pointer.
Note that the "syntax" here is just a variable of a template class, it's not a keyword or something.