File indexing completed on 2025-12-16 09:53:11
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_HISTOGRAM_LITERALS_HPP
0008 #define BOOST_HISTOGRAM_LITERALS_HPP
0009
0010 #include <type_traits>
0011
0012 namespace boost {
0013 namespace histogram {
0014 namespace detail {
0015 constexpr unsigned parse_number(unsigned n) { return n; }
0016
0017 template <class... Rest>
0018 constexpr unsigned parse_number(unsigned n, char f, Rest... rest) {
0019 return parse_number(10u * n + static_cast<unsigned>(f - '0'), rest...);
0020 }
0021 }
0022
0023 namespace literals {
0024
0025 template <char... digits>
0026 auto operator"" _c() {
0027 return std::integral_constant<unsigned, detail::parse_number(0, digits...)>();
0028 }
0029 }
0030 }
0031 }
0032
0033 #endif