File indexing completed on 2025-01-18 09:38:12
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_HISTOGRAM_DETAIL_TYPE_NAME_HPP
0008 #define BOOST_HISTOGRAM_DETAIL_TYPE_NAME_HPP
0009
0010 #include <boost/core/typeinfo.hpp>
0011 #include <boost/type.hpp>
0012 #include <string>
0013
0014 namespace boost {
0015 namespace histogram {
0016 namespace detail {
0017
0018 template <class T>
0019 std::string type_name_impl(boost::type<T>) {
0020 return boost::core::demangled_name(BOOST_CORE_TYPEID(T));
0021 }
0022
0023 template <class T>
0024 std::string type_name_impl(boost::type<T const>) {
0025 return type_name_impl(boost::type<T>{}) + " const";
0026 }
0027
0028 template <class T>
0029 std::string type_name_impl(boost::type<T&>) {
0030 return type_name_impl(boost::type<T>{}) + " &";
0031 }
0032
0033 template <class T>
0034 std::string type_name_impl(boost::type<T&&>) {
0035 return type_name_impl(boost::type<T>{}) + " &&";
0036 }
0037
0038 template <class T>
0039 std::string type_name() {
0040 return type_name_impl(boost::type<T>{});
0041 }
0042
0043 }
0044 }
0045 }
0046
0047 #endif