structs inheriting from and implementing interfaces
rjframe
dlang at ryanjframe.com
Tue Jan 2 02:56:32 UTC 2018
On Tue, 02 Jan 2018 00:54:13 +0000, Laeeth Isharc wrote:
> On Friday, 29 December 2017 at 12:59:21 UTC, rjframe wrote:
>> On Fri, 29 Dec 2017 12:39:25 +0000, Nicholas Wilson wrote:
>>
>> I've actually thought about doing this to get rid of a bunch of if
>> qualifiers in my function declarations. `static interface {}` compiles
>> but doesn't [currently] seem to mean anything to the compiler, but
>> could be a hint to the programmer that nothing will directly implement
>> it; it's a compile-time interface. This would provide a more generic
>> way of doing stuff like `isInputRange`, etc.
>
> Atila does something like this
>
> https://code.dlang.org/packages/concepts
Thanks; I actually started skimming through his repositories a couple of
days ago, but didn't see this.
--Ryan
More information about the Digitalmars-d-learn
mailing list