Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Static polymorp...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 44050 of 48022
Post > Topic >>

Static polymorphism

by Olaf <olaf@[EMAIL PROTECTED] > Mar 21, 2008 at 07:41 PM

Hello,

for my data parser I want to use different generic checking policies 
using static polymorphism. But the way I've used won't compile (concrete 
the grammar class). The check policy p***** the data the parse actions 
which fills (and knows about) the data container.

What is the correct syntax for this? Note, that boost::spirit::grammar 
self uses static polymorphism.

Thanks,
Olaf

---8<---
struct parse_actions { ... };

struct parse_error_handler { ... };

template<typename DerivedT, typename ActionsT>
struct check_policy
{
     explicit check_policy( const ActionsT& actions )
     ...
};

template <typename ActionsT      = parse_actions,
           typename CheckPolicyT  = check_policy,
           typename ErrorHandlerT = parse_error_handler>
struct grammar :
     CheckPolicyT< grammar<CheckPolicyT, ActionsT, ErrorHandlerT> >,
     boost::spirit::grammar<
        grammar<CheckPolicyT, ActionsT, ErrorHandlerT>
     >
{
     explicit grammar(const ActionsT& actions      = ActionsT(),
                      const ErrorHandlerT& handler = ErrorHandlerT())
         : CheckPolicyT( actions ),
           actions(actions),
           error_handler(handler)
     { }

--->8---
 




 4 Posts in Topic:
Static polymorphism
Olaf <olaf@[EMAIL PROT  2008-03-21 19:41:14 
Re: Static polymorphism
acehreli@[EMAIL PROTECTED  2008-03-21 14:56:31 
Re: Static polymorphism
Olaf <olaf@[EMAIL PROT  2008-03-22 19:19:09 
Re: Static polymorphism
acehreli@[EMAIL PROTECTED  2008-03-27 13:38:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 11:27:02 CDT 2008.