[webkit-dev] Style guideline on initializing non-POD types via member initialization

Simon Fraser simon.fraser at apple.com
Thu Mar 14 12:59:37 PDT 2019

I've seen some code recently that initializes non-POD members via initializers. For example, SVGAElement has:

    AttributeOwnerProxy m_attributeOwnerProxy { *this };

I find this a little disorientating, and would normally expect to see this in the constructor as m_attributeOwnerProxy(*this), as it makes it easier to find places to set breakpoints, and the ordering of initialization is easier to see.

Are people OK with this pattern, or should we discourage it via the style guidelines (and style checker)?


More information about the webkit-dev mailing list