Boost logo

Boost Users :

Subject: Re: [Boost-users] Disabling Tokenizer in Derived Classes - after their constructors have been executed.
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-08-03 15:55:32


> I have boost tokenizer and its iterator stored in my base class. The
> tokenizer got initialized with a const std::string&. I do the
> tokenization in my base class and provide the iterator, pointing to the
> first token, to the derived classes - but only to be used in their
> constructors. After the derived class constructor has been executed,
> the tokenizer and its iterator should not remain available - what can I
> do to accomplish that?

[This is less of a boost issue and more of a general design issue...]

Why do the tokenizer and the iterator need to be in the base class at all?

Why not just construct them on the stack in the derived constructor?

Regards,
Nate
                                               


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net