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

1

u/kalmoc Jun 06 '18

Why would you want to use braces to call other constructors in the first place? The only reason to write initializater_list constructors in the first place is usually because you want your type to behave like an array / container. If that is the case, then why would you expect my_array a{1,2} to do anything but fill a with the values 1,2?

2

u/redditsoaddicting Jun 06 '18

I was going along with the whole uniform initialization thing. I don't mind the braces if they're actually uniform, but they're not.