1 // Copyright 2015-2018 Hans Dembinski
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_HISTOGRAM_DETAIL_ARGS_TYPE_HPP
8 #define BOOST_HISTOGRAM_DETAIL_ARGS_TYPE_HPP
17 struct args_type_impl {
18 using T::ERROR_this_should_never_be_instantiated_please_write_an_issue;
21 template <class R, class T, class... Ts>
22 struct args_type_impl<R (T::*)(Ts...)> {
23 using type = std::tuple<Ts...>;
26 template <class R, class T, class... Ts>
27 struct args_type_impl<R (T ::*)(Ts...) const> {
28 using type = std::tuple<Ts...>;
31 template <class R, class... Ts>
32 struct args_type_impl<R (*)(Ts...)> {
33 using type = std::tuple<Ts...>;
36 #if __cpp_noexcept_function_type >= 201510
37 template <class R, class T, class... Ts>
38 struct args_type_impl<R (T::*)(Ts...) noexcept> {
39 using type = std::tuple<Ts...>;
42 template <class R, class T, class... Ts>
43 struct args_type_impl<R (T ::*)(Ts...) const noexcept> {
44 using type = std::tuple<Ts...>;
47 template <class R, class... Ts>
48 struct args_type_impl<R (*)(Ts...) noexcept> {
49 using type = std::tuple<Ts...>;
53 template <class FunctionPointer>
54 using args_type = typename args_type_impl<FunctionPointer>::type;
56 template <class T, std::size_t N = 0>
57 using arg_type = std::tuple_element_t<N, args_type<T>>;
60 } // namespace histogram