On Tue, Mar 12, 2013 at 12:39:48PM +0100, TommiT wrote: > On Tuesday, 12 March 2013 at 04:34:05 UTC, Walter Bright wrote: > >It's interfaces without the vtable[]. > > > >It's still solely based on type signatures. D constraints make > >pretty much anything that can be computed at compile time a > >testable gate. > > Yeah, you're right. That kind of interface syntax doesn't really > lend itself to specifying concepts. So, here's another attempt at > a concept syntax (and functionality): > > concept AscendingInfiniteInputRange { > // 'this' is an instance of a type which implements the > // AscendingInfiniteInputRange concept given the > // if-condition below is true: > if( is(typeof(this.empty) : bool) > && is(typeof(this.front)) > && !is(typeof(this.front) == void) > && is(typeof(this.popFront() == void) > // testing a compile time evaluable value: > && this.empty == false > // static members can also be tested: > && typeof(this).infinite == true > && typeof(this).sortedAscending == true ) > }
How is this any different from the current isInputRange!R, isForwardRange!R, etc.? T -- Дерево держится корнями, а человек - друзьями.