slist.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_SLIST_HPP
  11. #define BOOST_ASSIGN_STD_SLIST_HPP
  12. #include <boost/config.hpp>
  13. #ifdef BOOST_HAS_SLIST
  14. #if defined(_MSC_VER)
  15. # pragma once
  16. #endif
  17. #include <boost/assign/list_inserter.hpp>
  18. #include <boost/move/utility.hpp>
  19. #ifdef BOOST_SLIST_HEADER
  20. # include BOOST_SLIST_HEADER
  21. #else
  22. # include <slist>
  23. #endif
  24. namespace boost
  25. {
  26. namespace assign
  27. {
  28. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  29. template< class V, class A, class V2 >
  30. inline list_inserter< assign_detail::call_push_back< BOOST_STD_EXTENSION_NAMESPACE::slist<V,A> >, V >
  31. operator+=( BOOST_STD_EXTENSION_NAMESPACE::slist<V,A>& c, V2 v )
  32. {
  33. return push_back( c )( v );
  34. }
  35. #else
  36. template< class V, class A, class V2 >
  37. inline list_inserter< assign_detail::call_push_back< BOOST_STD_EXTENSION_NAMESPACE::slist<V,A> >, V >
  38. operator+=( BOOST_STD_EXTENSION_NAMESPACE::slist<V,A>& c, V2&& v )
  39. {
  40. return push_back( c )( boost::forward<V2>(v) );
  41. }
  42. #endif
  43. }
  44. }
  45. #endif // BOOST_HAS_SLIST
  46. #endif