A Briefer Syntax for Using Concepts

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Wed May 7 05:09:17 PDT 2014


On Wednesday, 7 May 2014 at 11:57:51 UTC, w0rp wrote:
> Here is a question, is it possible for D, or any future 
> language, to eventually take something like this...
>
> void foo(InputRange)(InputRange range) 
> if(isInputRange!InputRange);
>
> ...and to instead be able to write it like this?
>
> void foo(InputRange range);
>
> Where the latter expands into something like the former, and 
> InputRange is not a type. How to declare such a thing in the 
> first place doesn't matter that much. There are many ways that 
> could be done. I'm just wondering if the above is possible at 
> all.

I sense a polymorphic compile-time-only type system.


More information about the Digitalmars-d mailing list