Posted patch to update Code Style Guidelines at < https://bugs.webkit.org/show_bug.cgi?id=176058>. Dan On Mon, Aug 28, 2017 at 9:24 PM, Daniel Bates <dbates@webkit.org> wrote:
Hi all,
I am writing to propose using C++11 uniform initializer syntax in member initializer lists. The following:
class A { public: A(B&& b, float i, int j) : m_b(WTFMove(b)) , m_i(i) , m_j(j) { } ... };
Would become:
class A { public: A(B&& b, float i, int j) : m_b { WTFMove(b) } , m_i { i } , m_j { j } { } ... };
Using uniform initializer syntax in member initializer lists would make the syntax we use for member initializer lists consistent with the syntax we use for non-static data member initializers. It would also cause a compile time error if member initialization required a narrowing conversion (e.g. implicit float to int conversion). Another benefit of using this syntax is that it allows initialization of a struct using aggregate initialization.
Dan