Boost logo

Boost :

Subject: Re: [boost] [language] determine sence of language proposal concerning the 'default'-keyword
From: Jakob Riedle (jakob.riedle_at_[hidden])
Date: 2015-04-09 03:55:39

Gavin Lambert
> This may be a bikeshed, but why not use auto()?
> This would retain "auto" as "infer the appropriate type here" and "()"
> as "invoke with no parameters", together implying a constructor call.
> And it avoids overloading yet another keyword.

That's a good idea and probably way more straightforward, thanks!

Vicente J. Botet Escriba
> Note that {} means already IMPLICIT default constructor.

Of course I know of this type of initialization.
There is still a problem in readability: Are you passing some kind of empty list '{}',
or do you want to construct an object using the default ctor,
which most often leads to an initialized, that is non-empty object. => Counterintuitivity

Furthermore, there is no way to initialize an object this way,
if one ctor takes an std::initializer_list.

Gavin Lambert
> Although ultimately if you're mostly concerned about typing long names,
> then typedef is your friend.


As it's a good idea to use 'auto()' instead, because it's the forehead of template-less type-deduction,
why not complete the set of 'auto'-deducing features?

Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at