NDDEM
Public Member Functions | Public Attributes | Private Types | Private Member Functions | Related Functions | List of all members
cereal::SizeTag< T > Class Template Reference

A wrapper around size metadata. More...

#include <helpers.hpp>

Public Member Functions

 SizeTag (T &&sz)
 

Public Attributes

Type size
 

Private Types

using Type = typename std::conditional< std::is_lvalue_reference< T >::value, T, typename std::decay< T >::type >::type
 

Private Member Functions

SizeTagoperator= (SizeTag const &)=delete
 

Related Functions

(Note that these are not member functions.)

template<class T >
SizeTag< T > make_size_tag (T &&sz)
 Creates a size tag from some variable. More...
 

Detailed Description

template<class T>
class cereal::SizeTag< T >

A wrapper around size metadata.

This class provides a way for archives to have more flexibility over how they choose to serialize size metadata for containers. For some archive types, the size may be implicitly encoded in the output (e.g. JSON) and not need an explicit entry. Specializing serialize or load/save for your archive and SizeTags allows you to choose what happens.

Member Typedef Documentation

◆ Type

template<class T >
using cereal::SizeTag< T >::Type = typename std::conditional<std::is_lvalue_reference<T>::value, T, typename std::decay<T>::type>::type
private

Constructor & Destructor Documentation

◆ SizeTag()

template<class T >
cereal::SizeTag< T >::SizeTag ( T &&  sz)
inline

Member Function Documentation

◆ operator=()

template<class T >
SizeTag& cereal::SizeTag< T >::operator= ( SizeTag< T > const )
privatedelete

Friends And Related Function Documentation

◆ make_size_tag()

template<class T >
SizeTag< T > make_size_tag ( T &&  sz)
related

Creates a size tag from some variable.

Will normally be used to serialize size (e.g. size()) information for variable size containers. If you have a variable sized container, the very first thing it serializes should be its size, wrapped in a SizeTag.

Member Data Documentation

◆ size

template<class T >
Type cereal::SizeTag< T >::size

The documentation for this class was generated from the following files: