OGLplus  (0.59.0) a C++ wrapper for rendering APIs

type_name.hpp
Go to the documentation of this file.
1 #ifndef EAGINE_TYPE_NAME_HPP
9 #define EAGINE_TYPE_NAME_HPP
10 
11 #include "config/basic.hpp"
12 
13 #include <string>
14 #include <typeinfo>
15 
16 namespace eagine {
17 
18 auto demangle_type_name(const char*) noexcept -> std::string;
19 
23 template <typename T>
24 static inline auto type_name(const T&) noexcept -> std::string {
25  return demangle_type_name(typeid(T).name());
26 }
27 
31 template <typename T>
32 static inline auto type_name() noexcept -> std::string {
33  return demangle_type_name(typeid(T).name());
34 }
35 
36 } // namespace eagine
37 
38 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
39 #include <eagine/type_name.inl>
40 #endif
41 
42 #endif // EAGINE_TYPE_NAME_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
static auto type_name(const T &) noexcept -> std::string
Returns the demangled name for type T.
Definition: type_name.hpp:24

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).