Tuesday, November 12, 2019

c++11 - When to use emplace* and when to use push/insert

I know of general idea of emplace functions on containers("construct new element inplace").
My question is not what it does,
but more of like Effective C++11 one.



What are good rules for deciding when to use (for eg when it comes to std::vector)
emplace_back() and when to use push_back() and in general emplace* vs "old" insert functions?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...