Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Enumerations | Functions
20.meta.trans.sign.cpp File Reference
#include <rw_driver.h>
#include <rw/_defs.h>
#include <type_traits>
#include <stddef.h>
Include dependency graph for 20.meta.trans.sign.cpp:

Go to the source code of this file.

Data Structures

struct  test_is_same< T, U >
 
struct  test_is_same< T, T >
 

Macros

#define _RETURN_TYPE_NAME(T)    const char* get_type_name (T*) { return #T; }
 
#define _RETURN_TYPE_NAME_CV(T)
 
#define _TEST(Trait, TypeT, TypeU)
 
#define TEST(Trait, TypeT, TypeU)
 
#define _TEST_SIGN_AND_CV(Trait, Type, Signed)
 
#define TEST_MAKE_SIGNED(Type)
 
#define TEST_MAKE_UNSIGNED(Type)
 

Enumerations

enum  enum_SS { Ess_v = _RWSTD_SCHAR_MAX }
 
enum  enum_MS { Ems_v = _RWSTD_INT_MAX }
 
enum  enum_LS { Els_v = _RWSTD_LONG_MAX }
 
enum  enum_SU { Esu_v = _RWSTD_UCHAR_MAX }
 
enum  enum_MU { Emu_v = _RWSTD_UINT_MAX }
 
enum  enum_LU { Elu_v = _RWSTD_ULONG_MAX }
 

Functions

template<class T >
int test_cv_qual (T &)
 
template<class T >
int test_cv_qual (const T &)
 
template<class T >
int test_cv_qual (volatile T &)
 
template<class T >
int test_cv_qual (const volatile T &)
 
const char * get_type_name (const volatile void *)
 
void test_trait (int line, bool same, const char *trait, const char *typeT, const char *typeU, const char *typeV)
 
void test_sign_and_cv (int line, const char *trait_name, const char *type_name, size_t got_size, size_t exp_size, bool got_sign, bool exp_sign, bool got_c, bool exp_c, bool got_v, bool exp_v)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ _RETURN_TYPE_NAME

#define _RETURN_TYPE_NAME (   T)     const char* get_type_name (T*) { return #T; }

Definition at line 89 of file 20.meta.trans.sign.cpp.

◆ _RETURN_TYPE_NAME_CV

#define _RETURN_TYPE_NAME_CV (   T)
Value:
_RETURN_TYPE_NAME(const T) \
_RETURN_TYPE_NAME(volatile T) \
_RETURN_TYPE_NAME(const volatile T)
#define T
Definition 17.names.cpp:163
#define _RETURN_TYPE_NAME(T)

Definition at line 92 of file 20.meta.trans.sign.cpp.

◆ _TEST

#define _TEST (   Trait,
  TypeT,
  TypeU 
)
Value:
test_trait(__LINE__, \
std::is_same<Trait<TypeT>::type, TypeU>::value, \
#Trait, #TypeT, #TypeU, get_type_name((Trait<TypeT>::type*)0))
void test_trait(int line, bool same, const char *trait, const char *typeT, const char *typeU, const char *typeV)
const char * get_type_name(const volatile void *)
T value(const T &val)

Definition at line 133 of file 20.meta.trans.sign.cpp.

◆ _TEST_SIGN_AND_CV

#define _TEST_SIGN_AND_CV (   Trait,
  Type,
  Signed 
)
Value:
test_sign_and_cv(__LINE__, #Trait, #Type, \
sizeof (Trait<Type>::type), \
sizeof (Type), \
std::is_signed<Trait<Type>::type>::value, \
Signed, \
std::is_const<Trait<Type>::type>::value, \
std::is_const<Type>::value, \
std::is_volatile<Trait<Type>::type>::value, \
std::is_volatile<Type>::value)
void test_sign_and_cv(int line, const char *trait_name, const char *type_name, size_t got_size, size_t exp_size, bool got_sign, bool exp_sign, bool got_c, bool exp_c, bool got_v, bool exp_v)

Definition at line 173 of file 20.meta.trans.sign.cpp.

◆ TEST

#define TEST (   Trait,
  TypeT,
  TypeU 
)
Value:
_TEST(Trait, TypeT, TypeU); \
_TEST(Trait, const TypeT, const TypeU); \
_TEST(Trait, volatile TypeT, volatile TypeU); \
_TEST(Trait, const volatile TypeT, const volatile TypeU)
#define _TEST(Trait, TypeT, TypeU)

Definition at line 138 of file 20.meta.trans.sign.cpp.

◆ TEST_MAKE_SIGNED

#define TEST_MAKE_SIGNED (   Type)
Value:
_TEST_SIGN_AND_CV (std::make_signed, Type, true); \
_TEST_SIGN_AND_CV (std::make_signed, const Type, true); \
_TEST_SIGN_AND_CV (std::make_signed, volatile Type, true); \
_TEST_SIGN_AND_CV (std::make_signed, const volatile Type, true)
#define _TEST_SIGN_AND_CV(Trait, Type, Signed)

Definition at line 184 of file 20.meta.trans.sign.cpp.

◆ TEST_MAKE_UNSIGNED

#define TEST_MAKE_UNSIGNED (   Type)
Value:
_TEST_SIGN_AND_CV (std::make_unsigned, Type, false); \
_TEST_SIGN_AND_CV (std::make_unsigned, const Type, false); \
_TEST_SIGN_AND_CV (std::make_unsigned, volatile Type, false); \
_TEST_SIGN_AND_CV (std::make_unsigned, const volatile Type, false)

Definition at line 190 of file 20.meta.trans.sign.cpp.

Enumeration Type Documentation

◆ enum_LS

enum enum_LS
Enumerator
Els_v 

Definition at line 76 of file 20.meta.trans.sign.cpp.

◆ enum_LU

enum enum_LU
Enumerator
Elu_v 

Definition at line 80 of file 20.meta.trans.sign.cpp.

◆ enum_MS

enum enum_MS
Enumerator
Ems_v 

Definition at line 75 of file 20.meta.trans.sign.cpp.

◆ enum_MU

enum enum_MU
Enumerator
Emu_v 

Definition at line 79 of file 20.meta.trans.sign.cpp.

◆ enum_SS

enum enum_SS
Enumerator
Ess_v 

Definition at line 74 of file 20.meta.trans.sign.cpp.

◆ enum_SU

enum enum_SU
Enumerator
Esu_v 

Definition at line 78 of file 20.meta.trans.sign.cpp.

Function Documentation

◆ get_type_name()

const char * get_type_name ( const volatile void *  )

Definition at line 84 of file 20.meta.trans.sign.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 303 of file 20.meta.trans.sign.cpp.

◆ test_cv_qual() [1/4]

template<class T >
int test_cv_qual ( const T &  )

Definition at line 60 of file 20.meta.trans.sign.cpp.

◆ test_cv_qual() [2/4]

template<class T >
int test_cv_qual ( const volatile T &  )

Definition at line 70 of file 20.meta.trans.sign.cpp.

◆ test_cv_qual() [3/4]

template<class T >
int test_cv_qual ( T &  )

Definition at line 55 of file 20.meta.trans.sign.cpp.

◆ test_cv_qual() [4/4]

template<class T >
int test_cv_qual ( volatile T &  )

Definition at line 65 of file 20.meta.trans.sign.cpp.

◆ test_sign_and_cv()

void test_sign_and_cv ( int  line,
const char *  trait_name,
const char *  type_name,
size_t  got_size,
size_t  exp_size,
bool  got_sign,
bool  exp_sign,
bool  got_c,
bool  exp_c,
bool  got_v,
bool  exp_v 
)

Definition at line 146 of file 20.meta.trans.sign.cpp.

◆ test_trait()

void test_trait ( int  line,
bool  same,
const char *  trait,
const char *  typeT,
const char *  typeU,
const char *  typeV 
)

Definition at line 122 of file 20.meta.trans.sign.cpp.