Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
sizeGetter Class Reference

Returns the sizeof() of a type. Accepts void (and returns size 0), which is not supported by std::numeric_limits. More...

#include <TypeUtils.h>

Public Types

typedef std::size_t value_t
 

Static Public Member Functions

template<class S , class T >
static T callback ()
 

Static Protected Member Functions

template<class S >
static size_t getSize ()
 
template<>
size_t getSize ()
 

Detailed Description

Returns the sizeof() of a type. Accepts void (and returns size 0), which is not supported by std::numeric_limits.

Usage: Type::call<drain::sizeGetter>(t)

sizeof() returns size in bytes, so 1 for char, 2 for short int and so on.

Todo: renaming to byteSizeGetter, and adding bitSizeGetter

Member Function Documentation

◆ callback()

static T callback ( )
inlinestatic
Template Parameters
S- type to be analyzed
T- destination type (practically value_t)

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