
16 Oct
2011
16 Oct
'11
12:03 a.m.
So, you desperately want to optimize away an "if" check, but a copy operation on a typical class that cannot be default constructed is a-okay?
It's not like anyone has even bothered to ask for emplace_back, which would seem to me to be a far more important optimization opportunity if this were indeed a real-world use case...
Admittedly, I am in C++11-world and for this use case I was thinking of the move version of push_back(), or emplace_back() (yes, we do want these, and the fact that we haven't asked for them in this thread is simply because the recent discussion has been on a topic orthogonal to this, not because we don't want them). Regards, Nate