Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-02-23 09:35:04


"Bronek Kozicki" <brok_at_[hidden]> wrote in message
news:17harepl17tae$.1vurpce0boti4$.dlg_at_40tude.net...
> On Mon, 23 Feb 2004 19:17:08 +1100, Thorsten Ottosen wrote:
> > Why not change the existing constructor to
> >
> > template<class Container>
> > tokenizer( /*const*/ Container& c,const TokenizerFunc& f =
TokenizerFunc())
>
> you mean to comment out const-ness ? This would break following sample
> (an I believe quite typical) tokenizer usage:
> void parse(const std::string& a)
> {
> // typedef of Tokenizer, definition of separator s goes here
> Tokenizer t(a, s);
> // etc.
> }

Sure; the inefficiency of the copy-taking constructor should just be well
documented then. Your proposed change would probably not
break code, but it could make it much slower, silently.

br

Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk