[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Switch to using C++11 uniform initialization in the ctor initializ
From: |
Vadim Zeitlin |
Subject: |
[lmi] Switch to using C++11 uniform initialization in the ctor initializer lists? |
Date: |
Wed, 22 Aug 2018 23:35:51 +0200 |
Hello,
I now hesitate every time when initializing a member or a base class in
the ctor initializer list in lmi code as I'm not sure whether we're
supposed to use "uniform initialization" syntax for it, i.e. braces, or the
old-style parentheses. On one hand, I think we should use braces because
this is consistent with member initialization in their declarations and,
also, because it's safer (value-changing conversions are not performed by
this kind of initialization), but OTOH almost all the existing code, with
the exception of the html::text class I wrote, uses parentheses.
So I wonder about what of the following would you prefer:
0. Keep using parentheses in any new code.
1. Use braces in the new code and replace neighbouring parentheses with
the braces in this code only.
2. Replace all the existing parentheses with braces and use only the latter
ones in the future.
(I omit the variant "½. Use braces in the new code without changing
anything else" as having different kind of parentheses in the same file is
just too inconsistent to be acceptable IMO).
Thanks in advance,
VZ
- [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?,
Vadim Zeitlin <=
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Greg Chicares, 2018/08/22
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Vadim Zeitlin, 2018/08/23
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Greg Chicares, 2018/08/23
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Vadim Zeitlin, 2018/08/23
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Greg Chicares, 2018/08/23
- [lmi] Better unit tests, Vadim Zeitlin, 2018/08/23
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Vadim Zeitlin, 2018/08/23
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Greg Chicares, 2018/08/23
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Vadim Zeitlin, 2018/08/24
- Re: [lmi] Switch to using C++11 uniform initialization in the ctor initializer lists?, Greg Chicares, 2018/08/27