Skip to content

Commit

Permalink
Implement type_name on GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
ldionne committed Nov 10, 2023
1 parent 83346ca commit 94134b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/boost/hana/experimental/type_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ namespace boost { namespace hana { namespace experimental {
template <typename T>
constexpr cstring type_name_impl2() {

#if defined(__clang__)
#if defined(BOOST_HANA_CONFIG_CLANG)
constexpr char const* pretty_function = __PRETTY_FUNCTION__;
constexpr std::size_t total_size = sizeof(__PRETTY_FUNCTION__) - 1;
constexpr std::size_t prefix_size = sizeof("cstring boost::hana::experimental::detail::type_name_impl2() [T = ") - 1;
constexpr std::size_t suffix_size = sizeof("]") - 1;
#elif defined(BOOST_HANA_CONFIG_GCC)
constexpr char const* pretty_function = __PRETTY_FUNCTION__;
constexpr std::size_t total_size = sizeof(__PRETTY_FUNCTION__) - 1;
constexpr std::size_t prefix_size = sizeof("boost::hana::experimental::detail::cstring boost::hana::experimental::detail::type_name_impl2() [with T = ") - 1;
constexpr std::size_t suffix_size = sizeof("]") - 1;
#else
#error "No support for this compiler."
#endif
Expand Down

0 comments on commit 94134b1

Please sign in to comment.