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_RELAXED_TUPLE_SIZE_HPP
0008 #define BOOST_HISTOGRAM_DETAIL_RELAXED_TUPLE_SIZE_HPP
0009 
0010 #include <type_traits>
0011 
0012 namespace boost {
0013 namespace histogram {
0014 namespace detail {
0015 
0016 using dynamic_size = std::integral_constant<std::size_t, static_cast<std::size_t>(-1)>;
0017 
0018 // Returns static size of tuple or dynamic_size
0019 template <class T>
0020 constexpr dynamic_size relaxed_tuple_size(const T&) noexcept {
0021   return {};
0022 }
0023 
0024 template <class... Ts>
0025 constexpr std::integral_constant<std::size_t, sizeof...(Ts)> relaxed_tuple_size(
0026     const std::tuple<Ts...>&) noexcept {
0027   return {};
0028 }
0029 
0030 template <class T>
0031 using relaxed_tuple_size_t = decltype(relaxed_tuple_size(std::declval<T>()));
0032 
0033 } // namespace detail
0034 } // namespace histogram
0035 } // namespace boost
0036 
0037 #endif