|
Boost : |
From: Pavol Droba (droba_at_[hidden])
Date: 2005-07-13 16:08:19
On Wed, Jul 13, 2005 at 09:22:17PM +0300, Peter Dimov wrote:
> Pavol Droba wrote:
> > Hi,
> >
> > This is an interesting observation. So it seems reasonable to drop
> > back to 1.32 version.
>
> The only reasonable thing is for split to return N+1 pieces for a string
> with N separators, if you ask me. :-) This is lossless in the sense that it
> allows you to reconstruct the original string. The non-reasonable behavior
> can easily be implemented on top of that, but not vice versa.
>
Reading your replies and thinking about it a little bit, I come to conclusion,
that the definition above is realy to only reasonable one. That was actualy
also the reason why I have altered the behaviour in this release. Beacuse
I considered the former one as wrong.
But now there is still issue about the empty string. I think, that both approaches
- returning no token
- returing one empty token
have some meaning.
The second one is very similar to returnig an empty token at the end if the input
string ends with a separator.
The first one simply tells that nothing equals nothing.
Yet I prefer the second approach, since it is more on par with the current reasoning.
Does anybody have some arguments/reasoning that can help here?
Regards,
Pavol
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk