cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
type_name.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_BASIC_TYPE_NAME_H
4#define pRC_CORE_BASIC_TYPE_NAME_H
5
7
8namespace pRC
9{
10 template<class T>
11 static inline constexpr auto name()
12 {
13 constexpr String s = __PRETTY_FUNCTION__;
14 constexpr auto offset = s.find('=') + 2;
15 constexpr auto length = s.size() - offset - 1;
16
17 return s.template substring<offset, length>();
18 }
19
20 template<auto T>
21 static inline constexpr auto name()
22 {
23 constexpr String s = __PRETTY_FUNCTION__;
24 constexpr auto offset = s.find('=') + 2;
25 constexpr auto length = s.size() - offset - 1;
26
27 return s.template substring<offset, length>();
28 }
29}
30#endif // pRC_CORE_BASIC_TYPE_NAME_H
Definition string.hpp:19
static constexpr auto size()
Definition string.hpp:21
constexpr auto find(char const character) const
Definition string.hpp:93
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto name()
Definition type_name.hpp:11
String(char const &) -> String< 1 >