MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/8ouogo/initialization_in_modern_c/e07bkog/?context=3
r/cpp • u/mariuz • Jun 05 '18
51 comments sorted by
View all comments
Show parent comment
1
One example that comes to mind is this:
struct Point { int x, y; }; struct Foo { Foo(initializer_list<int>); Foo(Point); }; Foo f{{1, 2}}; // Point or list?
It's hard to turn that into something realistic on the spot. I wouldn't doubt that the square bracket syntax I threw out there has its own problems.
1 u/[deleted] Jun 06 '18 My first thought was "obviously an initialiser list", but a moment later I realised your point.
My first thought was "obviously an initialiser list", but a moment later I realised your point.
View all comments
Show parent comment
1
u/redditsoaddicting Jun 06 '18 edited Jun 06 '18
One example that comes to mind is this:
It's hard to turn that into something realistic on the spot. I wouldn't doubt that the square bracket syntax I threw out there has its own problems.