1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // Copyright (c) 2020 Oracle and/or its affiliates.
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
11 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
13 // Use, modification and distribution is subject to the Boost Software License,
14 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 #ifndef BOOST_GEOMETRY_UTIL_PARAMETER_TYPE_OF_HPP
18 #define BOOST_GEOMETRY_UTIL_PARAMETER_TYPE_OF_HPP
21 #include <type_traits>
23 #include <boost/function_types/function_arity.hpp>
24 #include <boost/function_types/is_member_function_pointer.hpp>
25 #include <boost/function_types/parameter_types.hpp>
27 #include <boost/mpl/at.hpp>
30 namespace boost { namespace geometry
35 \brief Meta-function selecting a parameter type of a (member) function, by index
38 template <typename Method, std::size_t Index>
39 struct parameter_type_of
41 typedef typename boost::function_types::parameter_types
44 >::type parameter_types;
46 typedef std::conditional_t
48 boost::function_types::is_member_function_pointer<Method>::value,
49 std::integral_constant<int, 1>,
50 std::integral_constant<int, 0>
53 typedef std::conditional_t
57 std::integral_constant
60 (base_index_type::value + Index)
64 typedef typename std::remove_reference
66 typename boost::mpl::at
75 }} // namespace boost::geometry
78 #endif // BOOST_GEOMETRY_UTIL_PARAMETER_TYPE_OF_HPP