cereal
A C++11 library for serialization
 All Classes Files Functions Variables Typedefs Enumerations Groups
Public Types | Public Member Functions | Public Attributes | List of all members
cereal::MapItem< Key, Value > Struct Template Reference

A wrapper around a key and value for serializing data into maps. More...

#include <cereal/details/helpers.hpp>

Public Types

using DecayKey = typename std::decay< Key >::type
 
using KeyType = typename std::conditional< std::is_rvalue_reference< Key >::value, DecayKey, typename std::add_lvalue_reference< DecayKey >::type >::type
 
using DecayValue = typename std::decay< Value >::type
 
using ValueType = typename std::conditional< std::is_rvalue_reference< Value >::value, DecayValue, typename std::add_lvalue_reference< DecayValue >::type >::type
 

Public Member Functions

 MapItem (Key &&key, Value &&value)
 Construct a MapItem from a key and a value.
 
template<class Archive >
void serialize (Archive &archive)
 Serialize the MapItem with the NVPs "key" and "value".
 

Public Attributes

KeyType key
 
ValueType value
 

Detailed Description

template<class Key, class Value>
struct cereal::MapItem< Key, Value >

A wrapper around a key and value for serializing data into maps.

This class just provides a grouping of keys and values into a struct for human readable archives. For example, XML archives will use this wrapper to write maps like so:

<mymap>
<item0>
<key>MyFirstKey</key>
<value>MyFirstValue</value>
</item0>
<item1>
<key>MySecondKey</key>
<value>MySecondValue</value>
</item1>
</mymap>
See Also
make_map_item

The documentation for this struct was generated from the following file: