1 #ifndef BOOST_SERIALIZATION_QUEUE_HPP
2 #define BOOST_SERIALIZATION_QUEUE_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2014 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
20 #include <boost/config.hpp>
21 #include <boost/mpl/eval_if.hpp>
22 #include <boost/mpl/identity.hpp>
24 // function specializations must be defined in the appropriate
25 // namespace - boost::serialization
26 #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
33 namespace serialization {
36 template <typename U, typename C>
37 struct queue_save : public STD::queue<U, C> {
38 template<class Archive>
39 void operator()(Archive & ar, const unsigned int file_version) const {
40 save(ar, STD::queue<U, C>::c, file_version);
43 template <typename U, typename C>
44 struct queue_load : public STD::queue<U, C> {
45 template<class Archive>
46 void operator()(Archive & ar, const unsigned int file_version) {
47 load(ar, STD::queue<U, C>::c, file_version);
53 template<class Archive, class T, class C>
54 inline void serialize(
56 std::queue< T, C> & t,
57 const unsigned int file_version
59 typedef typename mpl::eval_if<
60 typename Archive::is_saving,
61 mpl::identity<detail::queue_save<T, C> >,
62 mpl::identity<detail::queue_load<T, C> >
64 static_cast<typex &>(t)(ar, file_version);
67 } // namespace serialization
70 #include <boost/serialization/collection_traits.hpp>
72 BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::queue)
76 #endif // BOOST_SERIALIZATION_QUEUE_HPP