Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
typelist-diagnostics.hpp File Reference

Support for writing metaprogramming unit-tests dealing with typelists and flags. More...

Go to the source code of this file.

Description

Support for writing metaprogramming unit-tests dealing with typelists and flags.

a Printer template usable for debugging the structure of a typelist built upon some simple debugging-style types. Examples being a Num<int> template, or the Flag type. A Printer type generated from this template provides a static show() function. The string returned from this function visualises the structure of the typelist provided as parameter to the Printer template.

See also
typelist-manip-test.cpp
config-flags-test.cpp

Definition in file typelist-diagnostics.hpp.

Namespaces

namespace  lib
 Implementation namespace for support and library code.
 
namespace  lib::meta
 
namespace  lib::meta::test
 
namespace  lib::meta::test::anonymous_namespace{typelist-diagnostics.hpp}
 

Macros

#define DISPLAY(_IT_)    cout << STRINGIFY(_IT_) << "\t:" << showType<_IT_>() << endl;
 
#define DUMPVAL(_IT_)    cout << STRINGIFY(_IT_) << "\t:" << util::toString(_IT_) << endl;
 
#define EXPECT(_TY_, RENDERED_STRUCTURE)    CHECK (showType<_TY_>() == RENDERED_STRUCTURE ## _expect)
 

Classes

struct  Numz
 dummy interface / baseclass for diagnostics More...
 
struct  Num< I >
 constant-wrapper type for debugging purposes, usable for generating lists of distinguishable types More...
 
struct  CountDown< X >
 helper for generating test lists More...
 
struct  CountDown< Num< 0 > >
 
struct  CountDown< Num< I > >
 
struct  NullP
 
struct  Printer< T, BASE >
 debugging template, printing the "number" used for instantiation on ctor call More...
 
struct  Printer< Nil, BASE >
 
struct  Printer< Num< I >, BASE >
 < display the presence of a Num instance in the typelist More...
 
struct  Printer< Flag< Fl >, BASE >
 < display the presence of a Flag in the typelist More...
 
struct  Printer< int, BASE >
 < display the presence of a plain int in the typelist More...
 
struct  Printer< Node< TY, TYPES >, BASE >
 Specialisation for debug-printing of a nested sublist. More...
 
struct  Printer< Config< f1, f2, f3, f4, f5 >, BASE >
 

Functions

template<class LIST >
string printSublist ()
 call the debug-print for a typelist utilising the Printer template
 
template<typename TYPES >
enable_if< is_Typelist< TYPES >, string > showType ()
 

Macro Definition Documentation

◆ DISPLAY

#define DISPLAY (   _IT_)     cout << STRINGIFY(_IT_) << "\t:" << showType<_IT_>() << endl;

Definition at line 199 of file typelist-diagnostics.hpp.

◆ DUMPVAL

#define DUMPVAL (   _IT_)     cout << STRINGIFY(_IT_) << "\t:" << util::toString(_IT_) << endl;

Definition at line 202 of file typelist-diagnostics.hpp.

◆ EXPECT

#define EXPECT (   _TY_,
  RENDERED_STRUCTURE 
)     CHECK (showType<_TY_>() == RENDERED_STRUCTURE ## _expect)

Definition at line 205 of file typelist-diagnostics.hpp.


Class Documentation

◆ lib::meta::CountDown

struct lib::meta::CountDown
Class Members
typedef Nil List
+ Collaboration diagram for CountDown< X >:

◆ lib::meta::CountDown< Num< 0 > >

struct lib::meta::CountDown< Num< 0 > >
Class Members
typedef Node< Num< 0 >, Nil > List
+ Collaboration diagram for CountDown< Num< 0 > >:

◆ lib::meta::CountDown< Num< I > >

struct lib::meta::CountDown< Num< I > >
Class Members
typedef Node< Num< I >, typename CountDown< Num< I-1 > >::List > List
+ Collaboration diagram for CountDown< Num< I > >: