I have a base class that should provide an interface for certain string manipulations/matching.
The constructor would take a 'begin' and 'end' std::string::iterator to work on.
Each of the derived classes implement a particular functionality and have to produce a std::string as a result, an iterator denoting the current position and a boolean denoting success/failure.

My questions are:
1. What is the best place to perform the computation? (derived constructors or a virtual 'magic' function called when required.)
2. Should I store the three results as protected member variables and have the base class return them using normal methods when required or is a more 'virtual' way (three getters, I guess) better ?
3. How should I clean up? (the begin iterator has to be reset in case of failure, regardless to which derived class did the work)

I'm not posting any code now, but would do so after some suggestions or if I decide on an approach.