TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
typeid_name.hpp
Go to the documentation of this file.
1// Copyright (c) 2013-2018 Commissariat à l'énergie atomique et aux énergies alternatives (CEA)
2// Copyright (c) 2013-2018 Centre national de la recherche scientifique (CNRS)
3// Copyright (c) 2018 Simons Foundation
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You may obtain a copy of the License at
16// https://www.gnu.org/licenses/gpl-3.0.txt
17//
18// Authors: Olivier Parcollet, Nils Wentzell
19
24
25#pragma once
26
27#include <string>
28#include <typeinfo>
29
30namespace triqs::utility {
31
36
43 std::string demangle(const char *name);
44
46 std::string demangle(std::string const &name);
47
54 std::string get_name(std::type_info const &info);
55
63 template <typename T> std::string typeid_name(T const &obj) { return get_name(typeid(obj)); }
64
71 template <typename T> std::string typeid_name() { return get_name(typeid(T)); }
72
74
75} // namespace triqs::utility
std::string typeid_name()
Human-readable name of a given static type.
std::string demangle(const char *name)
Demangle a mangled C++ symbol name to a human-readable string.
std::string get_name(std::type_info const &info)
Demangle the name corresponding to an std::type_info.