Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
type-demangling-test.cpp
Go to the documentation of this file.
1/*
2 TypeDemangling(Test) - ensure a helper for C++ demangling works as expected
3
4 Copyright (C)
5 2014, 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/symbol.hpp"
20#include "lib/test/run.hpp"
21#include "lib/meta/util.hpp"
22
23#include <string>
24#include <iostream>
25
26using std::string;
27using std::cout;
28using std::endl;
29
30
31namespace lib {
32namespace meta{
33namespace test{
34
35 template<class T>
36 struct Outer
37 {
38 struct Inner { };
39
40 static const T*
41 cloak (Inner const&&)
42 {
43 return nullptr;
44 }
45 };
46
47 struct Space { };
48
49
50
51
52 /**********************************************/
61 class TypeDemangling_test : public Test
62 {
63 void
64 run (Arg)
65 {
67 auto magic = &ship.cloak;
68 auto rawType = typeid(magic).name();
69
70 cout << rawType << endl;
71 cout << demangleCxx(rawType) << endl;
72 }
73 };
74
75 LAUNCHER (TypeDemangling_test, "unit common");
76
77
78}}} // namespace lib::meta::test
Simple and lightweight helpers for metaprogramming and type detection.
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
string demangleCxx(Literal rawName)
Fallback type-ID:
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
static const T * cloak(Inner const &&)
Marker types to indicate a literal string and a Symbol.