if I have a templated inline function that takes an object by value
i.e.
if this function is called and inlined will T's copy ctor still get called?Code:template <typename T> void DoSomething(T someT) { // assume << is defined!! cout << someT; }
i.e.
I presume it's the latter, but can't find anything definite (and I can't use a reference, as DoSomething sometimes accepts a reference and reference to a reference is illegal)Code:ExpseniveToCopy etc; DoSomething(etc); //becomes either ExpseniveToCopy etc; cout <<etc; // or ExpseniveToCopy etc; ExpseniveToCopy someT(etc); cout << someT;