[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
- [lmi] More enabled warnings, less boost [Was: Third-millennium GOTW#1: is <int> special?], (continued)
- [lmi] More enabled warnings, less boost [Was: Third-millennium GOTW#1: is <int> special?], Greg Chicares, 2017/02/06
- Re: [lmi] More enabled warnings, less boost, Vadim Zeitlin, 2017/02/06
- Re: [lmi] More enabled warnings, less boost, Greg Chicares, 2017/02/06
- Re: [lmi] More enabled warnings, less boost, Vadim Zeitlin, 2017/02/06
Re: [lmi] Default values for default arguments, Greg Chicares, 2017/02/10
- Re: [lmi] Default values for default arguments, Vadim Zeitlin, 2017/02/10
- Re: [lmi] Default values for default arguments, Greg Chicares, 2017/02/11
- Re: [lmi] Default values for default arguments, Greg Chicares, 2017/02/11
- Re: [lmi] Default values for default arguments, Vadim Zeitlin, 2017/02/11
- Re: [lmi] Default values for default arguments, Greg Chicares, 2017/02/11
- Re: [lmi] Default values for default arguments,
Vadim Zeitlin <=
[lmi] () or {} in initializer lists [Was: Default values for default arguments], Greg Chicares, 2017/02/22
Re: [lmi] () or {} in initializer lists [Was: Default values for default arguments], Vadim Zeitlin, 2017/02/22
Re: [lmi] () or {} in initializer lists [Was: Default values for default arguments], Greg Chicares, 2017/02/26
Re: [lmi] () or {} in initializer lists, Vadim Zeitlin, 2017/02/26