30 #ifndef CEREAL_TYPES_QUEUE_HPP_
31 #define CEREAL_TYPES_QUEUE_HPP_
43 namespace queue_detail
47 template <
class T,
class C>
inline
48 C
const &
container( std::queue<T, C>
const & queue )
50 struct H :
public std::queue<T, C>
52 static C
const & get( std::queue<T, C>
const & q )
58 return H::get( queue );
63 template <
class T,
class C,
class Comp>
inline
64 C
const &
container( std::priority_queue<T, C, Comp>
const & priority_queue )
66 struct H :
public std::priority_queue<T, C, Comp>
68 static C
const & get( std::priority_queue<T, C, Comp>
const & pq )
74 return H::get( priority_queue );
79 template <
class T,
class C,
class Comp>
inline
80 Comp
const &
comparator( std::priority_queue<T, C, Comp>
const & priority_queue )
82 struct H :
public std::priority_queue<T, C, Comp>
84 static Comp
const & get( std::priority_queue<T, C, Comp>
const & pq )
86 return pq.*(&H::comp);
90 return H::get( priority_queue );
95 template <
class Archive,
class T,
class C>
inline
98 ar(
CEREAL_NVP_(
"container", queue_detail::container( queue )) );
102 template <
class Archive,
class T,
class C>
inline
107 queue = std::queue<T, C>( std::move( container ) );
111 template <
class Archive,
class T,
class C,
class Comp>
inline
114 ar(
CEREAL_NVP_(
"comparator", queue_detail::comparator( priority_queue )) );
115 ar(
CEREAL_NVP_(
"container", queue_detail::container( priority_queue )) );
119 template <
class Archive,
class T,
class C,
class Comp>
inline
128 priority_queue = std::priority_queue<T, C, Comp>( comparator, std::move( container ) );
132 #endif // CEREAL_TYPES_QUEUE_HPP_