[Nfd-dev] C++11 code style

Davide Pesavento davide.pesavento at lip6.fr
Sun Nov 2 17:29:44 PST 2014


On Sun, Nov 2, 2014 at 6:20 PM, Junxiao Shi
<shijunxiao at email.arizona.edu> wrote:
> Dear folks
>
> We need to define some new code style rules for C++11 syntax.
>
[...]
>
> What other rules do we need?
>

* Initializer lists and uniform initializations [1]. Where can we use
them and how? Spaces around braces?

* New function declaration syntax with trailing return type. Can we use it?
(I'd say yes but only if really necessary)

* Static assertions [2]. Are they preferred to BOOST_STATIC_ASSERT?

* Right angle brackets. `list<list<int> >` or `list<list<int>>`? (the
latter syntax was not allowed in C++98)

* Strongly-typed (aka scoped) enumerations [3]. Can we use them? Are
they preferred to old-style enums? `enum struct` or `enum class`?

* Should we prefer new classes and functions of the standard library
(std::) when they're also available in boost?

[1] http://en.cppreference.com/w/cpp/language/list_initialization
[2] http://en.cppreference.com/w/cpp/language/static_assert
[3] http://en.cppreference.com/w/cpp/language/enum

Best,
Davide



More information about the Nfd-dev mailing list