Igor R wrote:
class prolog : public Entity ///<-----needs argument here but compains the 'prolog' is NOT a template
You should either make a decision about Entity template argument here, or make the above state (and all the FMS) a template.
[...]
virtual void parse( T begin, T end ) { };
What is "T" here? Again, probably you meant to make all the FSM templated?
Hello Igor. Short version : parse(T begin,T end) should iterators from asio::streambuf or any other Biderection iterators. Long version: Well all that I wanted was to have parse(T begin,T end) available on all states. class entity { public: virtual boost::regex& regex() const = 0; template<typename T> virtual void parse(T,T) = 0; }; I am not allowed to use 'template' on virtual methods (compiler error) so I moved the template parameter to be applied to the whole class: template<typename T> class entity { public: virtual boost::regex& regex() const = 0; virtual void parse(T,T) = 0; }; But then I needed to pass a template parameter to class prolog because it is derived from class entity and therefore it needs to tell entity what type entity needs to be. And then when I needed to instantiate prolog the document class needed chainging also. Any Advice? Should I just make the whole thing a template? If I do so will there be a copy of the static data for each instantiated type? Etienne