Skip to content
Snippets Groups Projects
Commit 05a78838 authored by Max Kahnt's avatar Max Kahnt
Browse files

Improve documentation of CopyOrReference.

Other shall not doubt its right of existence in
times of perfect forwarding and convenient cv-modifiers.
parent fc261dbc
No related branches found
No related tags found
No related merge requests found
Pipeline #15360 passed
...@@ -21,6 +21,16 @@ namespace Solvers { ...@@ -21,6 +21,16 @@ namespace Solvers {
* *
* If T is of reference type, the wrapper stores a reference * If T is of reference type, the wrapper stores a reference
* to the passed object. Otherwise it stores a copy. * to the passed object. Otherwise it stores a copy.
*
* Internally, for reference type T, this wrapper stores a pointer, which
* results in CopyOrReference being copyable (etc.). This sets this wrapper
* apart from having a pure member type T in a class in particular.
* Furthermore, using this wrapper provides gclarity for the reader that type T
* may be both, of raw type or of reference type.
*
* Usage of this wrapper comes at the price of get()-semantics.
* As an alternative with pointer semantics consider using wrap_own_share but
* mind the dynamic overhead.
*/ */
template<class T> template<class T>
class CopyOrReference class CopyOrReference
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment