←back to thread

178 points todsacerdoti | 1 comments | | HN request time: 0.204s | source
Show context
xKingfisher ◴[] No.26340389[source]
Not to mention the very real risk of accidently invoking the wrong constructor. If you change the type of a vector, push_back is a good deal safer than emplace_back.

Especially since many of the standard containers have many more constructors that you'd think - hello std::vector(size_type count).

replies(2): >>26340429 #>>26340594 #
1. rq1 ◴[] No.26340429[source]
Use Phantom Types. The compiler will help you.