Chris@16: // Boost.Range library Chris@16: // Chris@16: // Copyright Neil Groves 2009. Use, modification and Chris@16: // distribution is subject to the Boost Software License, Version Chris@16: // 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // For more information, see http://www.boost.org/libs/range/ Chris@16: // Chris@16: #ifndef BOOST_RANGE_ALGORITHM_EXT_PUSH_BACK_HPP_INCLUDED Chris@16: #define BOOST_RANGE_ALGORITHM_EXT_PUSH_BACK_HPP_INCLUDED Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@101: #include Chris@16: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: namespace range Chris@16: { Chris@16: Chris@16: template< class Container, class Range > Chris@16: inline Container& push_back( Container& on, const Range& from ) Chris@16: { Chris@16: BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); Chris@16: BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); Chris@101: BOOST_ASSERT_MSG(!range_detail::is_same_object(on, from), Chris@101: "cannot copy from a container to itself"); Chris@16: on.insert( on.end(), boost::begin(from), boost::end(from) ); Chris@16: return on; Chris@16: } Chris@16: Chris@16: } // namespace range Chris@16: using range::push_back; Chris@16: } // namespace boost Chris@16: Chris@16: #endif // include guard