libpniio
Public Types | Static Public Member Functions
pni::io::conversion_trait< T > Struct Template Reference

default conversion trait More...

#include <conversion_trait.hpp>

Public Types

typedef T result_type
 the type requested by the user More...
 
typedef T read_type
 the type to read More...
 

Static Public Member Functions

static result_type convert (read_type &&v)
 conversion function More...
 
static result_type convert (const read_type &v)
 conversion function More...
 

Detailed Description

template<typename T>
struct pni::io::conversion_trait< T >

Conversion trait used to convert parsed data to the requested type. In this default version nothing has to be done as the type read from the string is the same as the type requested by the user.

Template Parameters
Tresult type

Member Typedef Documentation

template<typename T >
typedef T pni::io::conversion_trait< T >::read_type
template<typename T >
typedef T pni::io::conversion_trait< T >::result_type

Member Function Documentation

template<typename T >
static result_type pni::io::conversion_trait< T >::convert ( read_type &&  v)
inlinestatic

Conversion function taking an rvalue reference.

Parameters
vrvalue reference for type to convert
Returns
new value of type result_type
template<typename T >
static result_type pni::io::conversion_trait< T >::convert ( const read_type v)
inlinestatic

Conversion function taking an lvalue reference to the source value.

Parameters
vlvalue reference to the value to convert
Returns
new value of type result_type

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