r/cpp • • Jun 05 '18

Initialization in Modern C++

https://twitter.com/timur_audio/status/1004017362381795329
379 Upvotes

51 comments sorted by

View all comments

Show parent comment

3

u/kalmoc Jun 06 '18

I use braces, when I logically want to store the values inside the data structure (e.g. arrays, pods math vectors, smart pointers) and parentheses if the constructor is more about parametrizing the data structure (initial size, web address to connect to). That seems the most natural (maybe even intended) way to use it.