2 Comments
Apr 11, 2022Liked by Taras Tsugrii

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