From 05a78838e29374316a94a6f8bc2beea72c1db0b3 Mon Sep 17 00:00:00 2001 From: Max Kahnt <max.kahnt@fu-berlin.de> Date: Fri, 1 Mar 2019 16:49:42 +0100 Subject: [PATCH] Improve documentation of CopyOrReference. Other shall not doubt its right of existence in times of perfect forwarding and convenient cv-modifiers. --- dune/solvers/common/copyorreference.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dune/solvers/common/copyorreference.hh b/dune/solvers/common/copyorreference.hh index ae5a0689..fae26b78 100644 --- a/dune/solvers/common/copyorreference.hh +++ b/dune/solvers/common/copyorreference.hh @@ -21,6 +21,16 @@ namespace Solvers { * * If T is of reference type, the wrapper stores a reference * 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> class CopyOrReference -- GitLab