A small question default values in tmplate-functions

Uplink_Coder someemail at someprovider.some
Wed Jan 29 10:24:21 PST 2014


> import std.stdio;
> import core.vararg;
>
> auto veryStableAPI(bool brave = false)(string parameter, ...)
> {
> 	static if (!brave)
> 	{
> 		pragma(msg, "I'm not brave");
> 	}
> 	else
> 	{
> 		pragma(msg, "I'm very brave");
> 	}
> }
>
> void main(string[] args)
> {
> 	veryStableAPI("test");
> 	veryStableAPI!(true)("test");
> }

Sorry but that does not anwer my question.
is it legal or is it not ?



More information about the Digitalmars-d-learn mailing list