Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:12

0001 // Copyright 2019 Hans Dembinski
0002 //
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt
0005 // or copy at http://www.boost.org/LICENSE_1_0.txt)
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 } // namespace detail
0044 } // namespace histogram
0045 } // namespace boost
0046 
0047 #endif