Am 10.05.2012 11:55, schrieb "İbrahim Gökhan YANIKLAR"
<[email protected]>":
Concepts provide us a common interface for structs, classes,
interfaces, even arrays.
but for what then interfaces are?
but what concept should for example an array have? the typecheck of the
array itself???
Concepts can be practically extended.
if your world is very OOPish orientated - but the generic world
keeps itself away from "derived functionality"
Concepts can be used for template specialization and as compile
time constraints and as a static interface.
D current concepts can also be used like that - you just implement a
very lossy tied boolean expression (direct or as function) and thats it
- that is pure generic thinking
you don't need to be part of an hierarchy - just have the shape that is
needed
Also we can use concepts as traits like that:
static if (is(T : Concept)) { }
instead of
static if (satisfiesConcept!T) { }
but the type should only satisfy the concept
its does not need to derived from that - think of the thoundsand
of specialised concept-classes that will occure (for example in phobos)