deque.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_DEQUE_HPP
  11. #define BOOST_ASSIGN_STD_DEQUE_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 <deque>
  19. namespace boost
  20. {
  21. namespace assign
  22. {
  23. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  24. template< class V, class A, class V2 >
  25. inline list_inserter< assign_detail::call_push_back< std::deque<V,A> >, V >
  26. operator+=( std::deque<V,A>& c, V2 v )
  27. {
  28. return push_back( c )( v );
  29. }
  30. #else
  31. template< class V, class A, class V2 >
  32. inline list_inserter< assign_detail::call_push_back< std::deque<V, A> >, V >
  33. operator+=(std::deque<V, A>& c, V2&& v)
  34. {
  35. return push_back(c)(boost::forward<V2>(v));
  36. }
  37. #endif
  38. }
  39. }
  40. #endif