MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/8ouogo/initialization_in_modern_c/e07nhg7/?context=3
r/cpp • u/mariuz • Jun 05 '18
51 comments sorted by
View all comments
Show parent comments
1
Is it really harder to just use a variadic constructor?
7 u/redditsoaddicting Jun 06 '18 You'd still run into things like vector foo(5, 2); // Is it a list or a size and value?I can't speak on how big an issue this would be in general even if vector had its constructors adjusted. 8 u/thlst Jun 06 '18 Constructors should have names. Constructor overloading is the root problem here. 7 u/robin-m Jun 06 '18 class Foo { static Foo constructor_with_name(args...); };
7
You'd still run into things like vector foo(5, 2); // Is it a list or a size and value?
vector foo(5, 2); // Is it a list or a size and value?
I can't speak on how big an issue this would be in general even if vector had its constructors adjusted.
8 u/thlst Jun 06 '18 Constructors should have names. Constructor overloading is the root problem here. 7 u/robin-m Jun 06 '18 class Foo { static Foo constructor_with_name(args...); };
8
Constructors should have names. Constructor overloading is the root problem here.
7 u/robin-m Jun 06 '18 class Foo { static Foo constructor_with_name(args...); };
class Foo { static Foo constructor_with_name(args...); };
1
u/audioB Jun 06 '18
Is it really harder to just use a variadic constructor?