
13 Jun
2012
13 Jun
'12
8:49 p.m.
On 13/06/2012 22:43, Nevin Liber wrote:
On 13 June 2012 14:44, Gpderetta<gpderetta@gmail.com> wrote:
You can have a thin template forwarding to a single externally compiled implementation using for example rvalue references for all parameters. The template would copy or move depending on the actual parameter type.
So we've moved from 1 function to 2N+1 functions. I also don't quite see how this will work with member initializers, as I don't want to do construct-then-assign.
There is no magic. If you want different code fro 2^n cases, you need to have 2^n functions. You can generate them through a sngle template function, or you can write them all by hand.