
On Saturday 02 January 2010 16:17:03 Eric Niebler wrote:
The attached code compiles. You weren't handling the if_ case correctly. You had specialized ConstructGrammarCases on IfTag, but you weren't using IfTag anywhere, so that specialization wasn't getting picked up. There were a few other small problems, but on the whole, you were pretty close.
If I wanted to keep the IfRule case as a specialization, what should it be specialized on? IfTag was a leftover remnant, so that was a coding error. What I intended to do is this: template<> struct ConstructGrammarCases::case_keyword::if_ : boost::proto::when< IfRule, ConstructBinary<If>(ConstructGrammar(boost::proto::_right(boost::proto::_left)), ConstructGrammar(boost::proto::_right))> {}; But this leads to the compiler error seen earlier. Something like if_ is going to have to use a case_ specialization, so it's necessary to know how this is supposed to work. -Dave