Boost logo

Boost :

Subject: [boost] [language] determine sence of language proposal concerning the 'default'-keyword
From: Jakob Riedle (jakob.riedle_at_[hidden])
Date: 2015-04-08 17:31:06


Hello boost community,

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<some_very_long_template_param> arg = default ){

     return;

}

This would make things shorter, in the way 'auto' does it for types.

You could also do it for passing parameters:

foo( default );

This could interact very well with boost::optional, make it more intuitive and easier to use:

optional<int> bar( optional<some_long_type_name> arg = default ){

     return default;

}

bar( default );

This way, you don't have to write 'optional<some_long_type_name>()', both at the parameter and at the function call.

What do you think of such a language proposal?

Regards,

Jakob Riedle


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk