Don’t blindly prefer emplace_back to push_back (quuxplusone.github.io)
from tedu@inks.tedunangst.com to inks@inks.tedunangst.com on 03 Jan 08:11
https://inks.tedunangst.com/l/5142

I recommend sticking with push_back for day-to-day use. You should definitely use emplace_back when you need its particular set of skills — for example, emplace_back is your only option when dealing with a deque<mutex> or other non-movable type — but push_back is the appropriate default.

#cxx #programming

#cxx #inks #programming

threaded - newest