Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
typelist-util-test.cpp
Go to the documentation of this file.
1/*
2 TypeListUtil(Test) - check the simple typelist metaprogramming helpers
3
4 Copyright (C)
5 2011, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
19#include "lib/test/run.hpp"
21
22
23
24namespace lib {
25namespace meta {
26namespace test {
27
28
29
30 using TheList = Types< int
31 , uint
32 , int64_t
33 , uint64_t
34 >::List;
35
37
38
39
40 /*********************************************************************/
50 class TypeListUtil_test : public Test
51 {
52 void
53 run (Arg)
54 {
55 CHECK (4 == count<TheList>() );
56 CHECK (0 == count<EmptyList>());
57
58 CHECK (sizeof(int64_t) == maxSize<TheList>() );
59 CHECK (0 == maxSize<EmptyList>() );
60 CHECK (alignof(int64_t) == maxAlign<TheList>() );
62
67
70 CHECK (!bool(isInList<int , int>())); // Note: not-a-typelist yields false too
71 }
72 };
73
74
77
78
79
80}}} // namespace lib::meta::test
unsigned int uint
Definition integral.hpp:29
Types< int, uint, int64_t, uint64_t >::List TheList
Types< >::List EmptyList
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
variadic sequence of types
Definition typelist.hpp:102
Implementation namespace for support and library code.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Definition run.hpp:116
Metaprogramming: simple helpers for working with lists-of-types.