
On 12 June 2012 18:08, Ion GaztaƱaga <igaztanaga@gmail.com> wrote:
If I modify my implementation because I no longer need the internal copy (e.g. the copy was required by an internal function/helper function), I can't optimize the code and change the signature of the function to take a reference, as name mangling changes and I'll need to recompile the caller. If I offer both lvalue and rvalue reference variants I type a bit more but I can safely change the implementation.
On 13 June 2012 12:48, Mathias Gaunard <mathias.gaunard@ens-lyon.org> wrote:
On 06/13/2012 04:12 PM, Peter Dimov wrote:
Or 2^N overloads, if there's more than one argument to consume.
In which case, make your constructor a template so that all those overloads get generated through template instantiation, making use of the template type resolution mechanism specifically designed for perfect forwarding.
But if your constructor is a template, that code resides in the header, so don't you end up recompiling the caller anyway? -- Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404