
"Bronek Kozicki" <brok@rubikon.pl> wrote in message news:17harepl17tae$.1vurpce0boti4$.dlg@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