NeoN
A framework for CFD software
Loading...
Searching...
No Matches
demangle.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 - 2026 NeoN authors
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6// TODO For WIN builds, needs to be ifdef'ed out.
7#ifdef __GNUC__
8#include <cxxabi.h>
9#endif
10#include <string>
11#include <any>
12#include <iostream>
13
14namespace NeoN
15{
16
17std::string demangle(const char* mangledName);
18
19template<typename T, typename Container, typename Key>
20void logBadAnyCast(const std::bad_any_cast& e, const Key& key, const Container& data)
21{
22 std::cerr << "bad_any_cast: key='" << key << "', requested='" << demangle(typeid(T).name())
23 << "', actual='" << demangle(data.at(key).type().name()) << "': " << e.what() << "\n";
24}
25
26}
Integer types used throughout NeoN.
Definition array.hpp:18
std::string demangle(const char *mangledName)
const std::string & name(const NeoN::Document &doc)
Retrieves the name of a Document.
void logBadAnyCast(const std::bad_any_cast &e, const Key &key, const Container &data)
Definition demangle.hpp:20