
From: "Robert Kawulak" <kawulak@student.agh.edu.pl> Please don't snip attributions.
Use
void initialize(value_type & value_o);
rather than
value_type initialize();
Thus, when passed the data member to initialize, it can initialize that object directly. Granted, (N)RVO can often avoid the copy, but this change will ensure you get the efficiency.
I don't think so, because your version of initialize couldn't be used to initialize a value in constructor's initialization list. So first the value would be default-constructed, and then assigned another value using initialize.
Ah. If you're using it in an initializer list, then your version is better. (N)RVO is your friend in that case. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;