Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.
PrevUpHomeNext

Function trim_copy_if

boost::algorithm::trim_copy_if — Trim - parametric.

Synopsis

template<typename OutputIteratorT, typename CollectionT, typename PredicateT> 
OutputIteratorT 
trim_copy_if(OutputIteratorT Output, const CollectionT & Input, 
PredicateT IsSpace);
template<typename SequenceT, typename PredicateT> 
SequenceT trim_copy_if(const SequenceT & Input, PredicateT IsSpace);

Description

Remove all trailing and leading spaces from the input. The supplied predicate is used to determine which characters are considered spaces. The result is a trimmed copy of the input. It is returned as a sequence or copied to the output iterator

Parameters

Input

An input collection

IsSpace

An unary predicate identifying spaces

Output

An output iterator to which the result will be copied

Returns: An output iterator pointing just after the last inserted character or a copy of the input
Notes: The second variant of this function provides the strong exception-safety guarantee

Copyright 2002-2004 Pavol Droba

PrevUpHomeNext