Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2002-11-16 10:54:28


On Fri, Nov 15, 2002 at 01:12:59PM -0500, Rozental, Gennadiy wrote:
> > Trimming:
> >
> > Iterator trim_begin( Iterator InBegin, Iterator InEnd,
> > const std::locale& Loc=std::locale() )
> > Seq ltrim( const Seq& Input, const std::locale& Loc=std::locale() )
> > Seq& ltrim_in( Seq& Input, const std::locale& Loc=std::locale() )
> > Seq rtrim( const Seq& Input, const std::locale& Loc=std::locale() )
> > Seq& rtrim_in( Seq& Input, const std::locale& Loc=std::locale() )
> > Seq trim( const Seq& Input, const std::locale& Loc=std::locale() )
> > Seq& trim_in( Seq& Input, const std::locale& Loc=std::locale() )
>
> 1. I would prefer explisit names: trim_left, trim_right,...
I'm open for discussion about this. You are probably right. More peaole
were asking for more readable names. I will probably rename them soon.

> 2. Where do you specify what to trim? What If I want to trim "<>"
This is good point. Currently you can override isspace function, I think
I can provide variants with explicit predicate so everyone can write one
he needs.

> 3. why do we need not _in functions?
> If you want it that bad you could do something like:
> Seq& trim_copy( Seq& input, Seq& trim_func( Seq&, const std::locale& ) );

I have tried to explain my reasons in the other mail. Please try to consider them.
Generaly speaking I link functional approach of programming and non-modifying
transformatios are part of it.

Regards,

Pavol


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