lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Default values for default arguments


From: Vadim Zeitlin
Subject: Re: [lmi] Default values for default arguments
Date: Sat, 11 Feb 2017 21:54:01 +0100

On Sat, 11 Feb 2017 18:30:03 +0000 Greg Chicares <address@hidden> wrote:

GC> Okay. If we prefer braces here, then we must bear in mind that they
GC> might do surprising things depending on
GC>  - C++11 vs C++14
GC>  - whether or not the type has a std::initializer_list ctor

 I think the main conclusion here should be that defining a ctor taking an
std::initializer_list should be done only after careful consideration and
never at all if adding it introduces a risk of ambiguity with an existing
ctor. It's unfortunate that a class used as commonly as std::vector doesn't
follow this rule, but we'll just have to live with it.

 But in the absence of std::initializer_list-induced complications using {}
still seems like the best choice to me.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]