NDDEM
Public Types | Public Member Functions | List of all members
cereal::traits::detail::NoConvertRef< Source > Struct Template Reference

A struct that prevents implicit conversion. More...

#include <traits.hpp>

+ Inheritance diagram for cereal::traits::detail::NoConvertRef< Source >:

Public Types

using type = Source
 Used to get underlying type easily. More...
 

Public Member Functions

template<class Dest , class = typename std::enable_if<std::is_same<Source, Dest>::value>::type>
 operator Dest ()=delete
 
template<class Dest , class = typename std::enable_if<std::is_same<Source, Dest>::value>::type>
 operator Dest & ()
 only allow conversion if the types are the same and we are converting into a const reference More...
 

Detailed Description

template<class Source>
struct cereal::traits::detail::NoConvertRef< Source >

A struct that prevents implicit conversion.

Any type instantiated with this struct will be unable to implicitly convert to another type. Is designed to only allow conversion to Source &.

Template Parameters
Sourcethe type of the original source

Member Typedef Documentation

◆ type

template<class Source >
using cereal::traits::detail::NoConvertRef< Source >::type = Source

Used to get underlying type easily.

Member Function Documentation

◆ operator Dest()

template<class Source >
template<class Dest , class = typename std::enable_if<std::is_same<Source, Dest>::value>::type>
cereal::traits::detail::NoConvertRef< Source >::operator Dest ( )
delete

◆ operator Dest &()

template<class Source >
template<class Dest , class = typename std::enable_if<std::is_same<Source, Dest>::value>::type>
cereal::traits::detail::NoConvertRef< Source >::operator Dest & ( )

only allow conversion if the types are the same and we are converting into a const reference


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