Discussion about this post

User's avatar
Yacob Cohen-Arazi's avatar

It's a good point and unfortunately very little known feature. Meyers book also talks about it. BTW, you could overload build() with & and &&. i.e. qualify & and && at the end of the decl. so && will be used with an rvalue and & will be used with an lvalue. I think in the case above we might need to std::forward since inside the function, holder is lvalue.

Expand full comment
1 more comment...

No posts