00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "common/test/run.hpp"
00025 #include "common/meta/typelist.hpp"
00026
00027 #include <iostream>
00028
00029 using std::string;
00030 using std::cout;
00031
00032
00033 namespace lumiera
00034 {
00035 namespace typelist
00036 {
00037 namespace test
00038 {
00039
00040 template<int I>
00041 struct Block
00042 {
00043 Block() { cout << "- "<<I<<" -"; }
00044 };
00045 struct Zero
00046 {
00047 Zero() { cout << "- The End -"; }
00048 };
00049
00050
00051 typedef Types< Block<1>
00052 , Block<2>
00053 , Block<3>
00054 , Block<5>
00055 , Block<8>
00056 , Block<13>
00057 >::List TheList;
00058
00059
00060 template<class X, class P>
00061 class Chain
00062 : X, P
00063 { }
00064 ;
00065 template<class H, class T, class P>
00066 class Chain<Node<H,T>, P>
00067 : H, Chain<T,P>
00068 { }
00069 ;
00070
00071 typedef Chain<TheList,Zero> AssembledClass;
00072
00073
00074
00075
00076
00077
00078
00079 class TypeList_test : public Test
00080 {
00081 virtual void run(Arg arg)
00082 {
00083 AssembledClass wow_me_has_numbers;
00084
00085 cout << "\n..Size of = "
00086 << sizeof(wow_me_has_numbers) <<"\n";
00087 }
00088 };
00089
00090
00092 LAUNCHER (TypeList_test, "unit common");
00093
00094
00095
00096 }
00097
00098 }
00099
00100 }