ptr_deque.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // Boost.Pointer Container
  3. //
  4. // Copyright Thorsten Ottosen 2003-2005. Use, modification and
  5. // distribution is subject to the Boost Software License, Version
  6. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // For more information, see http://www.boost.org/libs/ptr_container/
  10. //
  11. #ifndef BOOST_PTR_CONTAINER_PTR_DEQUE_HPP
  12. #define BOOST_PTR_CONTAINER_PTR_DEQUE_HPP
  13. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  14. # pragma once
  15. #endif
  16. #include <deque>
  17. #include <boost/ptr_container/ptr_sequence_adapter.hpp>
  18. #include <boost/ptr_container/detail/ptr_container_disable_deprecated.hpp>
  19. #if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED)
  20. #pragma GCC diagnostic push
  21. #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  22. #endif
  23. namespace boost
  24. {
  25. template
  26. <
  27. class T,
  28. class CloneAllocator = heap_clone_allocator,
  29. class Allocator = std::allocator<typename ptr_container_detail::void_ptr<T>::type>
  30. >
  31. class ptr_deque : public
  32. ptr_sequence_adapter< T, std::deque<
  33. typename ptr_container_detail::void_ptr<T>::type,Allocator>,
  34. CloneAllocator >
  35. {
  36. typedef ptr_sequence_adapter< T, std::deque<
  37. typename ptr_container_detail::void_ptr<T>::type,Allocator>,
  38. CloneAllocator >
  39. base_class;
  40. typedef ptr_deque<T,CloneAllocator,Allocator> this_type;
  41. public:
  42. BOOST_PTR_CONTAINER_DEFINE_SEQEUENCE_MEMBERS( ptr_deque,
  43. base_class,
  44. this_type )
  45. };
  46. //////////////////////////////////////////////////////////////////////////////
  47. // clonability
  48. template< typename T, typename CA, typename A >
  49. inline ptr_deque<T,CA,A>* new_clone( const ptr_deque<T,CA,A>& r )
  50. {
  51. return r.clone().release();
  52. }
  53. /////////////////////////////////////////////////////////////////////////
  54. // swap
  55. template< typename T, typename CA, typename A >
  56. inline void swap( ptr_deque<T,CA,A>& l, ptr_deque<T,CA,A>& r )
  57. {
  58. l.swap(r);
  59. }
  60. }
  61. #if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED)
  62. #pragma GCC diagnostic pop
  63. #endif
  64. #endif