Should a C++ (implicit or explicit) value constructor accept its parameter(s) by value or reference-to-const, when it needs to store a copy of the argument(s) in its object
Honestly, for this case, the best option is making your constructor inline
, provided bar
's constructor does not throw. Then just pass by reference.
Also, as you suspected, your article does not apply here.
Look this question.
Use const T & arg
if sizeof(T)>sizeof(void*)
and use T arg
if sizeof(T) <= sizeof(void*)
. All fundamental types should be the exception to this rule