|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61519 - in branches/release/boost/range: algorithm algorithm_ext
From: neil_at_[hidden]
Date: 2010-04-23 19:19:00
Author: neilgroves
Date: 2010-04-23 19:18:59 EDT (Fri, 23 Apr 2010)
New Revision: 61519
URL: http://svn.boost.org/trac/boost/changeset/61519
Log:
Boost.Range correct missing items from merge by merging these changes manually.
This changeset is what should have happened with the prior svn merge operation.
Text files modified:
branches/release/boost/range/algorithm/fill_n.hpp | 1 +
branches/release/boost/range/algorithm_ext/erase.hpp | 9 ++++++---
branches/release/boost/range/algorithm_ext/insert.hpp | 7 ++++---
branches/release/boost/range/algorithm_ext/iota.hpp | 4 +++-
branches/release/boost/range/algorithm_ext/push_back.hpp | 3 ++-
branches/release/boost/range/algorithm_ext/push_front.hpp | 3 ++-
6 files changed, 18 insertions(+), 9 deletions(-)
Modified: branches/release/boost/range/algorithm/fill_n.hpp
==============================================================================
--- branches/release/boost/range/algorithm/fill_n.hpp (original)
+++ branches/release/boost/range/algorithm/fill_n.hpp 2010-04-23 19:18:59 EDT (Fri, 23 Apr 2010)
@@ -26,6 +26,7 @@
/// range-based version of the fill_n std algorithm
///
/// \pre ForwardRange is a model of the ForwardRangeConcept
+/// \pre n <= std::distance(boost::begin(rng), boost::end(rng))
template< class ForwardRange, class Size, class Value >
inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val)
{
Modified: branches/release/boost/range/algorithm_ext/erase.hpp
==============================================================================
--- branches/release/boost/range/algorithm_ext/erase.hpp (original)
+++ branches/release/boost/range/algorithm_ext/erase.hpp 2010-04-23 19:18:59 EDT (Fri, 23 Apr 2010)
@@ -24,29 +24,32 @@
{
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
Modified: branches/release/boost/range/algorithm_ext/insert.hpp
==============================================================================
--- branches/release/boost/range/algorithm_ext/insert.hpp (original)
+++ branches/release/boost/range/algorithm_ext/insert.hpp 2010-04-23 19:18:59 EDT (Fri, 23 Apr 2010)
@@ -23,15 +23,16 @@
{
template< class Container, class Range >
-inline void insert( Container& on,
- BOOST_DEDUCED_TYPENAME Container::iterator before,
- const Range& from )
+inline Container& insert( Container& on,
+ BOOST_DEDUCED_TYPENAME Container::iterator before,
+ const Range& from )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Range> ));
BOOST_ASSERT( (void*)&on != (void*)&from &&
"cannot copy from a container to itself" );
on.insert( before, boost::begin(from), boost::end(from) );
+ return on;
}
} // namespace range
Modified: branches/release/boost/range/algorithm_ext/iota.hpp
==============================================================================
--- branches/release/boost/range/algorithm_ext/iota.hpp (original)
+++ branches/release/boost/range/algorithm_ext/iota.hpp 2010-04-23 19:18:59 EDT (Fri, 23 Apr 2010)
@@ -22,7 +22,7 @@
{
template< class ForwardRange, class Value >
-inline void iota( ForwardRange& rng, Value x )
+inline ForwardRange& iota( ForwardRange& rng, Value x )
{
BOOST_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
typedef BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type iterator_t;
@@ -30,6 +30,8 @@
iterator_t last_target = ::boost::end(rng);
for (iterator_t target = ::boost::begin(rng); target != last_target; ++target, ++x)
*target = x;
+
+ return rng;
}
} // namespace range
Modified: branches/release/boost/range/algorithm_ext/push_back.hpp
==============================================================================
--- branches/release/boost/range/algorithm_ext/push_back.hpp (original)
+++ branches/release/boost/range/algorithm_ext/push_back.hpp 2010-04-23 19:18:59 EDT (Fri, 23 Apr 2010)
@@ -23,13 +23,14 @@
{
template< class Container, class Range >
-inline void push_back( Container& on, const Range& from )
+inline Container& push_back( Container& on, const Range& from )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Container> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const Range> ));
BOOST_ASSERT( (void*)&on != (void*)&from &&
"cannot copy from a container to itself" );
on.insert( on.end(), boost::begin(from), boost::end(from) );
+ return on;
}
} // namespace range
Modified: branches/release/boost/range/algorithm_ext/push_front.hpp
==============================================================================
--- branches/release/boost/range/algorithm_ext/push_front.hpp (original)
+++ branches/release/boost/range/algorithm_ext/push_front.hpp 2010-04-23 19:18:59 EDT (Fri, 23 Apr 2010)
@@ -23,13 +23,14 @@
{
template< class Container, class Range >
-inline void push_front( Container& on, const Range& from )
+inline Container& push_front( Container& on, const Range& from )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Container> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const Range> ));
BOOST_ASSERT( (void*)&on != (void*)&from &&
"cannot copy from a container to itself" );
on.insert( on.begin(), boost::begin(from), boost::end(from) );
+ return on;
}
} // namespace range
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk