30 #ifndef CEREAL_TYPES_UNORDERED_SET_HPP_
31 #define CEREAL_TYPES_UNORDERED_SET_HPP_
34 #include <unordered_set>
38 namespace unordered_set_detail
41 template <
class Archive,
class SetT>
inline
42 void save( Archive & ar, SetT
const & set )
44 ar( make_size_tag(
static_cast<size_type>(set.size()) ) );
46 for(
const auto & i : set )
51 template <
class Archive,
class SetT>
inline
52 void load( Archive & ar, SetT & set )
55 ar( make_size_tag( size ) );
58 set.reserve(
static_cast<std::size_t
>( size ) );
60 for( size_type i = 0; i < size; ++i )
62 typename SetT::key_type key;
65 set.emplace( std::move( key ) );
71 template <
class Archive,
class K,
class H,
class KE,
class A>
inline
74 unordered_set_detail::save( ar, unordered_set );
78 template <
class Archive,
class K,
class H,
class KE,
class A>
inline
81 unordered_set_detail::load( ar, unordered_set );
85 template <
class Archive,
class K,
class H,
class KE,
class A>
inline
88 unordered_set_detail::save( ar, unordered_multiset );
92 template <
class Archive,
class K,
class H,
class KE,
class A>
inline
95 unordered_set_detail::load( ar, unordered_multiset );
99 #endif // CEREAL_TYPES_UNORDERED_SET_HPP_