23 Jan
2010
23 Jan
'10
5:35 a.m.
On 1/23/2010 12:45 PM, Eric Niebler wrote:
template<typename Expr> void check_grammar(const Expr&e) { BOOST_MPL_ASSERT_MSG((proto::matches
::value), SYNTAX_NOT_CORRECT, (void)); // Dispatch to the correct impl depending on whether we have // a valid expression or not. check_grammar_impl(e, proto::matches ()); } That should reduce the noise gcc emits when your users create invalid expressions.
Yep. This is essentially what Spirit does. It's not perfect, but it works. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net http://www.facebook.com/djowel Meet me at BoostCon http://www.boostcon.com/home http://www.facebook.com/boostcon