Chris@16
|
1 // Boost.Range library
|
Chris@16
|
2 //
|
Chris@16
|
3 // Copyright Neil Groves 2009. Use, modification and
|
Chris@16
|
4 // distribution is subject to the Boost Software License, Version
|
Chris@16
|
5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
6 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
7 //
|
Chris@16
|
8 // For more information, see http://www.boost.org/libs/range/
|
Chris@16
|
9 //
|
Chris@16
|
10 #ifndef BOOST_RANGE_ALGORITHM_EXT_INSERT_HPP_INCLUDED
|
Chris@16
|
11 #define BOOST_RANGE_ALGORITHM_EXT_INSERT_HPP_INCLUDED
|
Chris@16
|
12
|
Chris@16
|
13 #include <boost/range/config.hpp>
|
Chris@16
|
14 #include <boost/range/concepts.hpp>
|
Chris@16
|
15 #include <boost/range/difference_type.hpp>
|
Chris@16
|
16 #include <boost/range/begin.hpp>
|
Chris@16
|
17 #include <boost/range/end.hpp>
|
Chris@16
|
18 #include <boost/assert.hpp>
|
Chris@16
|
19
|
Chris@16
|
20 namespace boost
|
Chris@16
|
21 {
|
Chris@16
|
22 namespace range
|
Chris@16
|
23 {
|
Chris@16
|
24
|
Chris@16
|
25 template< class Container, class Range >
|
Chris@16
|
26 inline Container& insert( Container& on,
|
Chris@16
|
27 BOOST_DEDUCED_TYPENAME Container::iterator before,
|
Chris@16
|
28 const Range& from )
|
Chris@16
|
29 {
|
Chris@16
|
30 BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
|
Chris@16
|
31 BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Range> ));
|
Chris@16
|
32 on.insert( before, boost::begin(from), boost::end(from) );
|
Chris@16
|
33 return on;
|
Chris@16
|
34 }
|
Chris@16
|
35
|
Chris@101
|
36 template< class Container, class Range >
|
Chris@101
|
37 inline Container& insert( Container& on, const Range& from )
|
Chris@101
|
38 {
|
Chris@101
|
39 BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
|
Chris@101
|
40 BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Range> ));
|
Chris@101
|
41 on.insert(boost::begin(from), boost::end(from));
|
Chris@101
|
42 }
|
Chris@101
|
43
|
Chris@16
|
44 } // namespace range
|
Chris@16
|
45 using range::insert;
|
Chris@16
|
46 } // namespace boost
|
Chris@16
|
47
|
Chris@16
|
48 #endif // include guard
|