++Phobos

Meta jared771 at gmail.com
Thu Oct 17 19:37:38 UTC 2019


On Thursday, 17 October 2019 at 16:21:18 UTC, Atila Neves wrote:
> On Wednesday, 16 October 2019 at 22:34:00 UTC, rikki cattermole 
> wrote:
>> On 17/10/2019 11:16 AM, H. S. Teoh wrote:
>>> [...]
>>
>> So these sorts of "functions" are aggregates of behavior and 
>> properties that require reading the source code to know fully 
>> what it entails.
>>
>> [...]
>
> https://github.com/atilaneves/concepts/blob/master/source/concepts/implements.d

Correct me if I'm wrong, but would using this with std.range be 
as simple as:

import std.range;

@implements!(MyCoolRange, InputRange)
struct MyCoolRange(T)
{
     ....
}

long sum(R)(R range)
if (implements!(R, InputRange))
{
     ....
}


More information about the Digitalmars-d mailing list