<div dir="ltr">Dear folks<div><br></div><div>List initialization: I suggest the following rule:</div><div><br></div><div>rule x. List initialization should have the following form:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">T object { arg1, arg2 };</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">T { arg1, arg2 };</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">new T { arg1, arg2 };</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">return { arg1, arg2 };</font></div><div><font face="courier new, monospace">function({ arg1, arg2 }, otherArgument);</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">object[{ arg1, arg2 }];</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">T({ arg1, arg2 })</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">class Class</font></div><div><font face="courier new, monospace">{</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">private:</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">  T m_member = { arg1, arg2 };</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">};</font></div><div><font face="courier new, monospace"><br></font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">Class::Class()</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">  : m_member { arg1, arg2 }</font></div><div><font face="courier new, monospace">{</font></div><div><font face="courier new, monospace">}</font></div><div><font face="courier new, monospace"><br></font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">T object = { arg1, arg2 };</font></div></blockquote></div><div><br></div><div>Static assertion: I suggest the following rule:</div><div><br></div><div>rule x. BOOST_ASSERT and BOOST_ASSERT_MSG are preferred over assert. BOOST_STATIC_ASSERT and BOOST_STATIC_ASSERT_MSG are preferred over static_assert.</div><div>The reason is that BOOST_* macros are more eye-catching with upper case.</div><div><br></div><div>Right angle brackets: std::list<std::list<int>> should be preferred. This doesn't need a new rule because it's not forbidden by any rule.</div><div><br></div><div>Strongly-typed enumerations: Yes we can use them. This doesn't need a new rule because it's not forbidden by any rule.</div><div><br></div><div>STL classes and functions vs Boost classes and functions: This isn't a code style problem. Generally STL is preferred.</div><div><br></div><div>Yours, Junxiao<br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 2, 2014 at 6:29 PM, Davide Pesavento <span dir="ltr"><<a href="mailto:davide.pesavento@lip6.fr" target="_blank">davide.pesavento@lip6.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
</span>* Initializer lists and uniform initializations [1]. Where can we use<br>
them and how? Spaces around braces?<br>
<br>
* New function declaration syntax with trailing return type. Can we use it?<br>
(I'd say yes but only if really necessary)<br>
<br>
* Static assertions [2]. Are they preferred to BOOST_STATIC_ASSERT?<br>
<br>
* Right angle brackets. `list<list<int> >` or `list<list<int>>`? (the<br>
latter syntax was not allowed in C++98)<br>
<br>
* Strongly-typed (aka scoped) enumerations [3]. Can we use them? Are<br>
they preferred to old-style enums? `enum struct` or `enum class`?<br>
<br>
* Should we prefer new classes and functions of the standard library<br>
(std::) when they're also available in boost?<br>
<br>
[1] <a href="http://en.cppreference.com/w/cpp/language/list_initialization" target="_blank">http://en.cppreference.com/w/cpp/language/list_initialization</a><br>
[2] <a href="http://en.cppreference.com/w/cpp/language/static_assert" target="_blank">http://en.cppreference.com/w/cpp/language/static_assert</a><br>
[3] <a href="http://en.cppreference.com/w/cpp/language/enum" target="_blank">http://en.cppreference.com/w/cpp/language/enum</a><br>
<br>
Best,<br>
Davide<br>
</blockquote></div><br></div></div></div>