syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 15 16:45:12 PST 2017


On Thursday, 16 February 2017 at 00:37:00 UTC, ZombineDev wrote:
> On Thursday, 16 February 2017 at 00:08:12 UTC, Walter Bright 
> wrote:
>> On 2/15/2017 12:31 PM, Jonathan M Davis via Digitalmars-d 
>> wrote:
>>> It's one of those features that I was surprised when you 
>>> couldn't do it.
>>
>> It was an oversight. We just never thought of it.
>
> What do you think about generalizing this feature to allow 
> introducing template value parameters without default value, 
> i.e.:
>
> // Note: `beg` and `end` have no default value
>
> auto bounded
>     (auto beg, auto end, auto onErrPolicy = Enforce("Value out 
> of range"), T)
>     (T value)
> {
>     return Bounded!(beg, end, Policy)(value);
> }
>

note that this would still be usable with constraits via e.g. 
if(is(typeof(beg) : int))


More information about the Digitalmars-d mailing list