File indexing completed on 2025-01-18 09:38:10
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_HISTOGRAM_DETAIL_ARGS_TYPE_HPP
0008 #define BOOST_HISTOGRAM_DETAIL_ARGS_TYPE_HPP
0009
0010 #include <tuple>
0011
0012 namespace boost {
0013 namespace histogram {
0014 namespace detail {
0015
0016 template <class T>
0017 struct args_type_impl {
0018 using T::ERROR_this_should_never_be_instantiated_please_write_an_issue;
0019 };
0020
0021 template <class R, class T, class... Ts>
0022 struct args_type_impl<R (T::*)(Ts...)> {
0023 using type = std::tuple<Ts...>;
0024 };
0025
0026 template <class R, class T, class... Ts>
0027 struct args_type_impl<R (T ::*)(Ts...) const> {
0028 using type = std::tuple<Ts...>;
0029 };
0030
0031 template <class R, class... Ts>
0032 struct args_type_impl<R (*)(Ts...)> {
0033 using type = std::tuple<Ts...>;
0034 };
0035
0036 #if __cpp_noexcept_function_type >= 201510
0037 template <class R, class T, class... Ts>
0038 struct args_type_impl<R (T::*)(Ts...) noexcept> {
0039 using type = std::tuple<Ts...>;
0040 };
0041
0042 template <class R, class T, class... Ts>
0043 struct args_type_impl<R (T ::*)(Ts...) const noexcept> {
0044 using type = std::tuple<Ts...>;
0045 };
0046
0047 template <class R, class... Ts>
0048 struct args_type_impl<R (*)(Ts...) noexcept> {
0049 using type = std::tuple<Ts...>;
0050 };
0051 #endif
0052
0053 template <class FunctionPointer>
0054 using args_type = typename args_type_impl<FunctionPointer>::type;
0055
0056 template <class T, std::size_t N = 0>
0057 using arg_type = std::tuple_element_t<N, args_type<T>>;
0058
0059 }
0060 }
0061 }
0062
0063 #endif