1 #ifndef BOOST_SERIALIZATION_PRIORITY_QUEUE_HPP
2 #define BOOST_SERIALIZATION_PRIORITY_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 2002 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>
22 // function specializations must be defined in the appropriate
23 // namespace - boost::serialization
24 #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
31 namespace serialization {
34 template <typename U, typename Container, typename Compare>
35 struct priority_queue_save : public STD::priority_queue<U, Container, Compare> {
36 template<class Archive>
37 void operator()(Archive & ar, const unsigned int file_version) const {
38 save(ar, STD::priority_queue<U, Container, Compare>::c, file_version);
41 template <typename U, typename Container, typename Compare>
42 struct priority_queue_load : public STD::priority_queue<U, Container, Compare> {
43 template<class Archive>
44 void operator()(Archive & ar, const unsigned int file_version) {
45 load(ar, STD::priority_queue<U, Container, Compare>::c, file_version);
51 template<class Archive, class T, class Container, class Compare>
52 inline void serialize(
54 std::priority_queue< T, Container, Compare> & t,
55 const unsigned int file_version
57 typedef typename mpl::eval_if<
58 typename Archive::is_saving,
59 mpl::identity<detail::priority_queue_save<T, Container, Compare> >,
60 mpl::identity<detail::priority_queue_load<T, Container, Compare> >
62 static_cast<typex &>(t)(ar, file_version);
65 } // namespace serialization
68 #include <boost/serialization/collection_traits.hpp>
70 BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::priority_queue)
74 #endif // BOOST_SERIALIZATION_PRIORITY_QUEUE_HPP