Ocean
Ocean::SignedTyper< T > Class Template Reference

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

Public Types

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

Static Public Attributes

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

Detailed Description

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

This class is a helper class allowing to determine the signed 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 (signed if possible) Data type
bool                  bool (but it is not signed)
char                  UNDEFINED, (as the signed of 'char' is not standardized)
unsigned char         signed char
short                 short
unsigned short        short
int                   int
unsigned int          int
long long             long long
unsigned long long    long long
float                 float
double                double

Beware: The resulting data type of SignedTyper<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 signed data type has to be found

Member Typedef Documentation

◆ Type

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

Definition of the signed data type, if existing.

Field Documentation

◆ hasSigned

template<typename T >
const bool Ocean::SignedTyper< T >::hasSigned = true
static

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

◆ isSigned

template<typename T >
const bool Ocean::SignedTyper< T >::isSigned = true
static

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


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