Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2002-11-19 13:37:51


Hi

On Mon, Nov 18, 2002 at 07:20:58PM -0500, Beman Dawes wrote:
> At 03:25 AM 11/18/2002, Pavol Droba wrote:
>
> >What I want to do in the future is to change default signature of trim to
>
> >something like you're proposing. There will be a variant with predicate
> and
> >a set of standard predicates. This way the locale stuff will be moved out
> >to the predicate and will not confuse you any more, I hope :)
>
> Please post the signatures when you think they are stable. I think I
> understand what you are planning, but it would be better to actually see
> it.
>

There is new version of the lib in the sandbox. Now it contains predicate variants
of all trim functions. I have also provided few default predicated to use.
They are in string_funct.hpp header and can be accessed via following helper functions.

if_isclassified( Type, Locale )
if_isspace( Locale )
if_isfrom( Seq )

all of them return instance to specific functor. isclassified was suggested by Genny Prota,
isspace is just instantiation if isclassified with std::ctype_base::space as the type.
isfrom functor lets you specify a range over set of elements you want to trim-out.

I have used the same naming scheme as in standard, so all variants which accept predicate
have _if suffix.

A have left original variants ( those without suffix ) and they are mapping to isspace functor.

Cheers,

Pavol


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