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

Description

Test:
Cover various aspects of the integration of our type sequences with the tuple type from the standard library
  • verify our generic tuple access decorator
  • verify generating tuple types from type list processing
  • TODO more helpers to come

Definition at line 75 of file tuple-helper-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void check_diagnostics ()
 verify the test input data
 
void check_tuple_from_Typelist ()
 
void demonstrate_generic_iteration ()
 
template<typename X >
string render ()
 
template<tuple_like X>
string render ()
 
void verify_tuple_like_concept ()
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

Definition at line 78 of file tuple-helper-test.cpp.

References TupleHelper_test::check_diagnostics(), TupleHelper_test::check_tuple_from_Typelist(), TupleHelper_test::demonstrate_generic_iteration(), and TupleHelper_test::verify_tuple_like_concept().

+ Here is the call graph for this function:

◆ check_diagnostics()

void check_diagnostics ( )
inlineprivate

verify the test input data

See also
TypeListManip_test::check_diagnostics() for an explanation of the DISPLAY macro

Definition at line 92 of file tuple-helper-test.cpp.

References DISPLAY, DUMPVAL, and EXPECT.

Referenced by TupleHelper_test::run().

+ Here is the caller graph for this function:

◆ check_tuple_from_Typelist()

void check_tuple_from_Typelist ( )
inlineprivate
Test:
verify the ability to generate tuple types from typelist metaprogramming
  • the resulting types are plain flat std::tuple instantiations
  • memory layout is identical to a POD, as expected
  • our generic string conversion is extended to work with tuples

Definition at line 122 of file tuple-helper-test.cpp.

References EXPECT.

Referenced by TupleHelper_test::run().

+ Here is the caller graph for this function:

◆ demonstrate_generic_iteration()

void demonstrate_generic_iteration ( )
inlineprivate
Test:
demonstrate generic tuple iteration mechanisms
  • apply a generic lambda to each element of a tuple
  • iterate over all index numbers of a tuple (or tuple-like)
Remarks
the iteration happens at compile-time, i.e. the given lambda-template is instantiated for each type of the tuple; however, at runtime, each of these instantiations is invoked in sequence, performing the body of the λ-function, which may access the actual data value for each of the tuple elements.

Definition at line 184 of file tuple-helper-test.cpp.

References lib::meta::dump(), lib::meta::forEach(), and lib::meta::mapEach().

Referenced by TupleHelper_test::run().

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

◆ render() [1/2]

template<typename X >
string render ( )
inlineprivate

Definition at line 237 of file tuple-helper-test.cpp.

◆ render() [2/2]

template<tuple_like X>
string render ( )
inlineprivate

Definition at line 244 of file tuple-helper-test.cpp.

◆ verify_tuple_like_concept()

void verify_tuple_like_concept ( )
inlineprivate
Test:
verify construction of a concept to detect tuple-like classes, which conform to the »tuple protocol« and can thus be used in structural bindings
  • the size of such an entity can be detected at compile time
  • essentially, these can be considered as product types — which implies that there are N element types
  • access to the corresponding member data is possible either through a get member function or free function detected by ADL

Definition at line 266 of file tuple-helper-test.cpp.

Referenced by TupleHelper_test::run().

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

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