There was discussion and proposal to extend D with static inheritance:
http://forum.dlang.org/thread/[email protected]

But it could be done just with mixins, UDAs and some rewriting of
predicates.

Exaple:

@concept!isInputRange()
struct Range
{
    mixin checkConcepts;

    int front()
    {
        return 0;
    }
}

concept-check ~master: building configuration "application"...
source/app.d(73,0): Error: can't test for empty
source/app.d(73,0): Error: can't invoke popFront()
source/app.d(67,5): Error: static assert "Range is not a concept!(isInputRange)"

checker function prototype:
    bool checkConcept(Flag!"verbose" verbose = No.verbose,
            string file = "", size_t line = "")()

if verbose==false this function could be used in template constraint just to check is template parameter match conditions without printing errors

full code:
http://dpaste.dzfl.pl/5056ad68c7b4

Reply via email to