Ocean
Ocean::UnsignedTyper< T > Class Template Reference

This class is a helper class allowing to determine the unsigned data type for a given data type if existing, otherwise the identity data type. More...

Public Types

typedef T Type
 Definition of the unsigned data type, if existing. More...
 

Static Public Attributes

static const bool isUnsigned = true
 True, if the data type T is an unsigned data type; False, otherwise. More...
 
static const bool hasUnsigned = true
 True, if the data has a corresponding unsigned data type (or itself is unsigned). More...
 

Detailed Description

template<typename T>
class Ocean::UnsignedTyper< T >

This class is a helper class allowing to determine the unsigned data type for a given data type if existing, otherwise the identity data type.

By default the resulting data type is identical with the given data type.
The following table shows the resulting data types which are different from the given data types:

Data type:            Resulting (unsigned if possible) Data type
bool                  bool (seems to be an unsigned data type)
char                  UNDEFINED, (as the signed of 'char' is not standardized)
signed char           unsigned char
unsigned char         unsigned char
short                 unsigned short
unsigned short        unsigned short
int                   unsigned int
unsigned int          unsigned int
long                  unsigned long
long long             unsigned long long
unsigned long long    unsigned long long
float                 float (no corresponding unsigned data type exists)
double                double (no corresponding unsigned data type exists)

Beware: The resulting data type of UnsignedTyper<T>::Type may be different from std::make_signed<T>::type (as e.g., std::make_signed<double>::type is not double).

Template Parameters
TData type for which the unsigned data type has to be found

Member Typedef Documentation

◆ Type

template<typename T >
typedef T Ocean::UnsignedTyper< T >::Type

Definition of the unsigned data type, if existing.

Field Documentation

◆ hasUnsigned

template<typename T >
const bool Ocean::UnsignedTyper< T >::hasUnsigned = true
static

True, if the data has a corresponding unsigned data type (or itself is unsigned).

◆ isUnsigned

template<typename T >
const bool Ocean::UnsignedTyper< T >::isUnsigned = true
static

True, if the data type T is an unsigned data type; False, otherwise.


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