On Fri, Apr 13, 2018 at 11:06 AM, Emilio Cobos Álvarez <emi...@crisal.io> wrote:
>> If we are going to have brace-initialization intermixed with
>> list-initialization (i.e. parentheses) in our codebase, I think we
>> should prefer no space prior to the brace, for consistency.
>
> Hmm, consistency with parenthesis I guess, but not with other things that
> use braces, like conditionals or other kind of declarations (where we use a
> space after the paren, for example), or lambdas where we use `mutable {`,
> etc.

Braces are used for a variety of purposes in C++. I think it makes
more sense to adapt the style to the purpose, than to try to enforce a
common style across all kinds of brace uses. We already do this; for
example, some uses of braces go on their own line, and others don't.

In this case, I think it makes sense for braces used for
initialization to be consistent with parentheses used for
initialization.

> Also, I guess per that argument we should use `mIsRootDefined{false}`
> instead of `mIsRootDefined{ false }`.

+1. `mIsRootDefined{false}` is what I've been using in constructor initializers.

Cheers,
Botond
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to