Boost.Range updated the return types of various algorithms to improve consistency. This is to address a specific request made during the formal review of Boost.RangeEx.

[SVN r61211]
This commit is contained in:
Neil Groves
2010-04-11 22:05:02 +00:00
parent cab01e8ba3
commit 350a1f8bfc
108 changed files with 937 additions and 605 deletions

View File

@ -24,29 +24,32 @@ namespace boost
{
template< class Container >
inline void erase( Container& on,
inline Container& erase( Container& on,
iterator_range<BOOST_DEDUCED_TYPENAME Container::iterator> to_erase )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
on.erase( boost::begin(to_erase), boost::end(to_erase) );
return on;
}
template< class Container, class T >
inline void remove_erase( Container& on, const T& val )
inline Container& remove_erase( Container& on, const T& val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
on.erase(
std::remove(boost::begin(on), boost::end(on), val),
boost::end(on));
return on;
}
template< class Container, class Pred >
inline void remove_erase_if( Container& on, Pred pred )
inline Container& remove_erase_if( Container& on, Pred pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
on.erase(
std::remove_if(boost::begin(on), boost::end(on), pred),
boost::end(on));
return on;
}
} // namespace range