File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
include/boost/hana/experimental Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -26,18 +26,23 @@ namespace boost { namespace hana { namespace experimental {
26
26
27
27
// Note: We substract the null terminator from the string sizes below.
28
28
template <typename T>
29
- constexpr cstring type_name_impl2 () {
30
-
31
- #if defined(__clang__)
29
+ constexpr auto type_name_impl2 () {
30
+ #if defined(BOOST_HANA_CONFIG_CLANG)
31
+ constexpr char const * pretty_function = __PRETTY_FUNCTION__;
32
+ constexpr std::size_t total_size = sizeof (__PRETTY_FUNCTION__) - 1 ;
33
+ constexpr std::size_t prefix_size = sizeof (" auto boost::hana::experimental::detail::type_name_impl2() [T = " ) - 1 ;
34
+ constexpr std::size_t suffix_size = sizeof (" ]" ) - 1 ;
35
+ #elif defined(BOOST_HANA_CONFIG_GCC)
32
36
constexpr char const * pretty_function = __PRETTY_FUNCTION__;
33
37
constexpr std::size_t total_size = sizeof (__PRETTY_FUNCTION__) - 1 ;
34
- constexpr std::size_t prefix_size = sizeof (" cstring boost::hana::experimental::detail::type_name_impl2() [T = " ) - 1 ;
38
+ constexpr std::size_t prefix_size = sizeof (" constexpr auto boost::hana::experimental::detail::type_name_impl2() [with T = " ) - 1 ;
35
39
constexpr std::size_t suffix_size = sizeof (" ]" ) - 1 ;
36
40
#else
37
41
#error "No support for this compiler."
38
42
#endif
39
43
40
- return {pretty_function + prefix_size, total_size - prefix_size - suffix_size};
44
+ cstring s{pretty_function + prefix_size, total_size - prefix_size - suffix_size};
45
+ return s;
41
46
}
42
47
43
48
template <typename T, std::size_t ...i>
You can’t perform that action at this time.
0 commit comments