On Thursday, 20 November 2014 at 22:35:51 UTC, IgorStepanov wrote:
class Patt
{
    // It is better then your static if.
// Compiler will raise better error message for incorrect operator.
    Seq opBinary(string op)(Patt rhs) if (op == "~")
    {
        return opCatImpl(rhs);
    }

protected Seq opCatImpl(Patt rhs) //you may override it in derived class
    {
        return seq(this, rhs);
    }
}

Great! I've update my code! Thanks!

Reply via email to