3 ms·
We cannot see the full code context from the blog post, but I felt similar about push_back() vs emplace_back() in the blog post example. Either of these are mo
by throwaway2037 2y ago
We cannot see the full code context from the blog post, but I felt similar about push_back() vs emplace_back() in the blog post example.
Either of these are more explicit and clear to me:
widgets.push_back(Widget(foo, bar, baz));
widgets.emplace_back(Widget(foo, bar, baz));
... even if computationally worse.