Should I use an empty initializer list for C++ containers? [duplicate]
I was recommended to initialize containers like this: std::vector< int > v = {}; The reason given is that this conforms with initializing all objects in C++, although it is obvious that omitting ={} will call the default constructor. Proponents of this style agree that there is no performance advantage, it is just about style. Is there really an advantage to this? I find that it just adds more characters to process mentally.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.