On 9/04/2015 09:31, Jakob Riedle wrote:
since this seems to me kind of a proving ground for new C++ library/language features I'd ask this question here.
Would you recon' writing a language proposal about:
using the 'default'-keyword as some standard way of calling the default ctor of variables.
I could imagine the following use-case:
void foo( some::very_long_name
arg = default ){ return; } This would make things shorter, in the way 'auto' does it for types.
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. It would have to de-reference intelligently when determining the constructor to call, though. Although ultimately if you're mostly concerned about typing long names, then typedef is your friend.