| 1 | // Boost.Assign library |
| 2 | // |
| 3 | // Copyright Thorsten Ottosen 2003-2004. Use, modification and |
| 4 | // distribution is subject to the Boost Software License, Version |
| 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
| 7 | // |
| 8 | // For more information, see http://www.boost.org/libs/assign/ |
| 9 | // |
| 10 | |
| 11 | |
| 12 | #ifndef BOOST_ASSIGN_STD_SET_HPP |
| 13 | #define BOOST_ASSIGN_STD_SET_HPP |
| 14 | |
| 15 | #if defined(_MSC_VER) |
| 16 | # pragma once |
| 17 | #endif |
| 18 | |
| 19 | #include <boost/assign/list_inserter.hpp> |
| 20 | #include <boost/config.hpp> |
| 21 | #include <boost/move/utility.hpp> |
| 22 | #include <set> |
| 23 | |
| 24 | namespace boost |
| 25 | { |
| 26 | namespace assign |
| 27 | { |
| 28 | |
| 29 | #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) |
| 30 | |
| 31 | template< class K, class C, class A, class K2 > |
| 32 | inline list_inserter< assign_detail::call_insert< std::set<K,C,A> >, K > |
| 33 | operator+=( std::set<K,C,A>& c, K2 k ) |
| 34 | { |
| 35 | return insert( c )( k ); |
| 36 | } |
| 37 | |
| 38 | template< class K, class C, class A, class K2 > |
| 39 | inline list_inserter< assign_detail::call_insert< std::multiset<K,C,A> >, K > |
| 40 | operator+=( std::multiset<K,C,A>& c, K2 k ) |
| 41 | { |
| 42 | return insert( c )( k ); |
| 43 | } |
| 44 | |
| 45 | #else |
| 46 | |
| 47 | template< class K, class C, class A, class K2 > |
| 48 | inline list_inserter< assign_detail::call_insert< std::set<K, C, A> >, K > |
| 49 | operator+=(std::set<K, C, A>& c, K2&& k) |
| 50 | { |
| 51 | return insert(c)(boost::forward<K2>(k)); |
| 52 | } |
| 53 | |
| 54 | template< class K, class C, class A, class K2 > |
| 55 | inline list_inserter< assign_detail::call_insert< std::multiset<K, C, A> >, K > |
| 56 | operator+=(std::multiset<K, C, A>& c, K2&& k) |
| 57 | { |
| 58 | return insert(c)(boost::forward<K2>(k)); |
| 59 | } |
| 60 | |
| 61 | #endif |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | #endif |
| 66 | |