Protocols vs Concepts?

Jacob Carlborg doob at me.com
Thu Nov 21 10:45:46 PST 2013


On 2013-11-21 17:02, Andrei Alexandrescu wrote:

> Interfaces can't check for a variety of things that Boolean conditions
> can (isInfinite comes to mind).

Why wouldn't you be able to put the implementation of isInfinite in an 
interface? I might no be any advantage over a template like it is now, 
but it should be possible.

One advantage interfaces have is that they support inheritance. It's 
easy to see which other properties are supported. Not as easy to see 
that isInfinite "inherits" from isInputRange.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list