set.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifndef BOOST_ASSIGN_STD_SET_HPP
  11. #define BOOST_ASSIGN_STD_SET_HPP
  12. #if defined(_MSC_VER)
  13. # pragma once
  14. #endif
  15. #include <boost/assign/list_inserter.hpp>
  16. #include <boost/config.hpp>
  17. #include <boost/move/utility.hpp>
  18. #include <set>
  19. namespace boost
  20. {
  21. namespace assign
  22. {
  23. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  24. template< class K, class C, class A, class K2 >
  25. inline list_inserter< assign_detail::call_insert< std::set<K,C,A> >, K >
  26. operator+=( std::set<K,C,A>& c, K2 k )
  27. {
  28. return insert( c )( k );
  29. }
  30. template< class K, class C, class A, class K2 >
  31. inline list_inserter< assign_detail::call_insert< std::multiset<K,C,A> >, K >
  32. operator+=( std::multiset<K,C,A>& c, K2 k )
  33. {
  34. return insert( c )( k );
  35. }
  36. #else
  37. template< class K, class C, class A, class K2 >
  38. inline list_inserter< assign_detail::call_insert< std::set<K, C, A> >, K >
  39. operator+=(std::set<K, C, A>& c, K2&& k)
  40. {
  41. return insert(c)(boost::forward<K2>(k));
  42. }
  43. template< class K, class C, class A, class K2 >
  44. inline list_inserter< assign_detail::call_insert< std::multiset<K, C, A> >, K >
  45. operator+=(std::multiset<K, C, A>& c, K2&& k)
  46. {
  47. return insert(c)(boost::forward<K2>(k));
  48. }
  49. #endif
  50. }
  51. }
  52. #endif