cereal
A C++11 library for serialization
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 </home/shane/workspace/cereal/include/cereal/details/helpers.hpp>

Public Types

using KeyType = typename std::conditional< std::is_lvalue_reference< Key >::value, Key, typename std::decay< Key >::type >::type
 
using ValueType = typename std::conditional< std::is_lvalue_reference< Value >::value, Value, typename std::decay< Value >::type >::type
 

Public Member Functions

 MapItem (Key &&key_, Value &&value_)
 Construct a MapItem from a key and a value.
 
MapItemoperator= (MapItem const &)=delete
 
template<class Archive >
void CEREAL_SERIALIZE_FUNCTION_NAME (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:

1 <mymap>
2  <item0>
3  <key>MyFirstKey</key>
4  <value>MyFirstValue</value>
5  </item0>
6  <item1>
7  <key>MySecondKey</key>
8  <value>MySecondValue</value>
9  </item1>
10 </mymap>
See also
make_map_item

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