Lumiera  0.pre.03
»edit your freedom«
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 
26 using std::string;
27 using std::cout;
28 using std::endl;
29 
30 
31 namespace lib {
32 namespace meta{
33 namespace 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  {
66  Outer<Space> ship;
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
Definition: run.hpp:40
Simple and lightweight helpers for metaprogramming and type detection.
Implementation namespace for support and library code.
Marker types to indicate a literal string and a Symbol.
Simplistic test class runner.
string demangleCxx(Literal rawName)
Fallback type-ID:
Definition: format-obj.cpp:159
ElementBoxWidget::Config::Qualifier name(string id)
define the name-ID displayed in the caption