Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
MetaUtils_test Class Reference

Description

Test:
verify basic type trait and metaprogramming helpers.
  • marker types to tell which overload the compiler picks
  • simple trait to detect the possibility of a string conversion
  • trait to detect (possibly) structured types (»tuple-like«)
  • trait to detect a typelist type

Definition at line 49 of file meta-utils-test.cpp.

Classes

struct  SomehowStringy
 
class  SomehowSubSub
 
struct  SomehowSubtle
 
class  Something
 
class  SubString
 

Private Types

using TheList = Types< int,uint,int64_t,uint64_t >::List
 
using EmptyList = Nil
 

Private Member Functions

void run (Arg)
 
void verify_basicTypeProbing ()
 
void verify_genericTypeDisplay ()
 
void detect_stringConversion ()
 
void detect_typeList ()
 

Static Private Member Functions

static Yes_t probe (int)
 
static No_t probe (...)
 
template<typename TY >
static bool can_convert (TY const &)
 

Class Documentation

◆ lib::meta::test::MetaUtils_test::Something

class lib::meta::test::MetaUtils_test::Something
+ Collaboration diagram for MetaUtils_test::Something:

Member Typedef Documentation

◆ TheList

using TheList = Types<int ,uint ,int64_t ,uint64_t >::List
private

Definition at line 169 of file meta-utils-test.cpp.

◆ EmptyList

using EmptyList = Nil
private

Definition at line 175 of file meta-utils-test.cpp.

Member Function Documentation

◆ run()

void run ( Arg  )
inlineprivate

Definition at line 52 of file meta-utils-test.cpp.

References MetaUtils_test::detect_stringConversion(), MetaUtils_test::detect_typeList(), MetaUtils_test::verify_basicTypeProbing(), and MetaUtils_test::verify_genericTypeDisplay().

+ Here is the call graph for this function:

◆ verify_basicTypeProbing()

void verify_basicTypeProbing ( )
inlineprivate
Test:
demonstrate the basic type trait detection technique:
  • we have two overloads with differing return type
  • we form a function call expression
  • by investigating the return type, we can figure out which overload the compiler picks.

Definition at line 69 of file meta-utils-test.cpp.

References MetaUtils_test::probe().

Referenced by MetaUtils_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ probe() [1/2]

static Yes_t probe ( int  )
staticprivate

Referenced by MetaUtils_test::verify_basicTypeProbing().

+ Here is the caller graph for this function:

◆ probe() [2/2]

static No_t probe (   ...)
staticprivate

◆ verify_genericTypeDisplay()

void verify_genericTypeDisplay ( )
inlineprivate

Definition at line 85 of file meta-utils-test.cpp.

References lib::meta::typeStr().

Referenced by MetaUtils_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ can_convert()

template<typename TY >
static bool can_convert ( TY const )
inlinestaticprivate

Definition at line 128 of file meta-utils-test.cpp.

Referenced by MetaUtils_test::detect_stringConversion().

+ Here is the caller graph for this function:

◆ detect_stringConversion()

void detect_stringConversion ( )
inlineprivate

Definition at line 134 of file meta-utils-test.cpp.

References MetaUtils_test::can_convert().

Referenced by MetaUtils_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ detect_typeList()

void detect_typeList ( )
inlineprivate

Definition at line 180 of file meta-utils-test.cpp.

Referenced by MetaUtils_test::run().

+ Here is the caller graph for this function:
+ Inheritance diagram for MetaUtils_test:
+ Collaboration diagram for MetaUtils_test:

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