On Mon, Jun 23, 2014 at 11:00 AM, Matt Beaumont-Gay
<[email protected]> wrote:
> On Mon, Jun 23, 2014 at 4:47 AM, Alexander Kornienko <[email protected]> 
> wrote:
>>
>> +Matt, who requested this feature.
>
> I did not know that 'explicit' had an expanded meaning in C++11. I bet
> that most cases in our codebase where 'explicit' is present on a
> multi-argument ctor are due to arguments being added to a one-argument
> ctor, rather than actively trying to avoid copy-list-initialization.

I would expect that you could complete that thought with
"…and most cases in our codebase where 'explicit' is absent on a
single-argument ctor are due to arguments being removed from a
two-argument ctor."

Is there really a good argument for forbidding multi-argument
'explicit' constructors in your style guide?  IMO it would be
reasonable for a C++11 style guide to treat 'explicit' the same way
that C++03 style guides evolved to treat 'break' in switch statements:
//every// case should have 'break' (or an explanatory comment), and
//every// ctor should have 'explicit' (or an explanatory comment).

(I've never seen a style guide that mandated 'explicit' on every ctor,
but then I've never seen one that prohibited it, either.)

–Arthur

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to