30 #ifndef CEREAL_TYPES_MAP_HPP_ 31 #define CEREAL_TYPES_MAP_HPP_ 41 template <
class Archive,
class MapT>
inline 42 void save( Archive & ar, MapT
const & map )
44 ar( make_size_tag( static_cast<size_type>(map.size()) ) );
46 for(
const auto & i : map )
53 template <
class Archive,
class MapT>
inline 54 void load( Archive & ar, MapT & map )
57 ar( make_size_tag( size ) );
61 auto hint = map.begin();
62 for(
size_t i = 0; i < size; ++i )
64 typename MapT::key_type key;
65 typename MapT::mapped_type value;
68 #ifdef CEREAL_OLDER_GCC 69 hint = map.insert( hint, std::make_pair(std::move(key), std::move(value)) );
70 #else // NOT CEREAL_OLDER_GCC 71 hint = map.emplace_hint( hint, std::move( key ), std::move( value ) );
72 #endif // NOT CEREAL_OLDER_GCC 78 template <
class Archive,
class K,
class T,
class C,
class A>
inline 81 map_detail::save( ar, map );
85 template <
class Archive,
class K,
class T,
class C,
class A>
inline 88 map_detail::load( ar, map );
93 template <
class Archive,
class K,
class T,
class C,
class A>
inline 96 map_detail::save( ar, multimap );
101 template <
class Archive,
class K,
class T,
class C,
class A>
inline 104 map_detail::load( ar, multimap );
108 #endif // CEREAL_TYPES_MAP_HPP_ MapItem< KeyType, ValueType > make_map_item(KeyType &&key, ValueType &&value)
Create a MapItem so that human readable archives will group keys and values together.
Definition: helpers.hpp:323
uint64_t size_type
The size type used by cereal.
Definition: helpers.hpp:59
Definition: access.hpp:39
Main cereal functionality.
#define CEREAL_LOAD_FUNCTION_NAME
The deserialization (load) function name to search for.
Definition: macros.hpp:58
#define CEREAL_SAVE_FUNCTION_NAME
The serialization (save) function name to search for.
Definition: macros.hpp:65