#include namespace proto = boost::proto; struct start_type {}; struct element_grammar: proto::or_< proto::terminal /* Replacing 1 with 0 makes the compilation error disappear. */ #if 0 , proto::terminal #endif > {}; struct grammar: proto::or_< element_grammar, proto::terminal, proto::divides > {}; template struct expression; struct domain: proto::domain, grammar> {}; template struct expression: proto::extends, domain> { typedef expression this_type; typedef proto::extends base_type; expression(const Expr &expr = Expr()): base_type(expr) {} }; expression::type> start; int main(int argc, char** argv) { auto expr = start / "123"; }