deque.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef BOOST_SERIALIZATION_DEQUE_HPP
  2. #define BOOST_SERIALIZATION_DEQUE_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // deque.hpp
  9. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  10. // Use, modification and distribution is subject to the Boost Software
  11. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. // See http://www.boost.org for updates, documentation, and revision history.
  14. #include <deque>
  15. #include <boost/config.hpp>
  16. #include <boost/serialization/collections_save_imp.hpp>
  17. #include <boost/serialization/collections_load_imp.hpp>
  18. #include <boost/serialization/split_free.hpp>
  19. namespace boost {
  20. namespace serialization {
  21. template<class Archive, class U, class Allocator>
  22. inline void save(
  23. Archive & ar,
  24. const std::deque<U, Allocator> &t,
  25. const unsigned int /* file_version */
  26. ){
  27. boost::serialization::stl::save_collection<
  28. Archive, std::deque<U, Allocator>
  29. >(ar, t);
  30. }
  31. template<class Archive, class U, class Allocator>
  32. inline void load(
  33. Archive & ar,
  34. std::deque<U, Allocator> &t,
  35. const unsigned int /*file_version*/
  36. ){
  37. boost::serialization::stl::load_collection<
  38. Archive,
  39. std::deque<U, Allocator>,
  40. boost::serialization::stl::archive_input_seq<
  41. Archive, std::deque<U, Allocator>
  42. >,
  43. boost::serialization::stl::no_reserve_imp<std::deque<U, Allocator> >
  44. >(ar, t);
  45. }
  46. // split non-intrusive serialization function member into separate
  47. // non intrusive save/load member functions
  48. template<class Archive, class U, class Allocator>
  49. inline void serialize(
  50. Archive & ar,
  51. std::deque<U, Allocator> &t,
  52. const unsigned int file_version
  53. ){
  54. boost::serialization::split_free(ar, t, file_version);
  55. }
  56. } // namespace serialization
  57. } // namespace boost
  58. #include <boost/serialization/collection_traits.hpp>
  59. BOOST_SERIALIZATION_COLLECTION_TRAITS(std::deque)
  60. #endif // BOOST_SERIALIZATION_DEQUE_HPP