I am currently reading Scott Meyer's "Effective Modern C++". In Item 42, he claims that e.g. an std::vector's emplace_back is usually, but not always as fast as or even faster than using push_back. He lists three conditions under which it should be at least as fast, but does not provide a counterexample in the case where these conditions are not all satisfied. Can someone provide me with an example where using emplace_back would be expected to result in strictly worse performance than using push_back?
Aucun commentaire:
Enregistrer un commentaire