Boost logo

Boost :

From: Philippe Vaucher (philippe.vaucher_at_[hidden])
Date: 2006-08-31 10:34:04


Hello,

When we look at the following declaration :

template<typename SequenceSequenceT, typename RangeT, typename PredicateT>
SequenceSequenceT& split(SequenceSequenceT & Result, RangeT & Input,
PredicateT Pred, token_compress_mode_type eCompress = token_compress_off);

Anyone knows why split() takes the input type by reference and not by const
reference ?
The current design prevents, say, passing a temporary string to split which
is imho something not convenient.

I'd want to be able to do code like :

string input = "/foo/bar";
vector<string> tokens;
split(tokens, input.substr(1), token_compress_off);

Thank you for your answers.
Philippe


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