forked from boostorg/range
added algorithm_ext insert algorithm for containers without a where iterator.
This commit is contained in:
@ -29,12 +29,18 @@ inline Container& insert( Container& on,
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
template< class Container, class Range >
|
||||
inline Container& insert( Container& on, const Range& from )
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Range> ));
|
||||
on.insert(boost::begin(from), boost::end(from));
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::insert;
|
||||
} // namespace boost
|
||||
|
Reference in New Issue
Block a user