Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:15

0001 /*=============================================================================
0002     Copyright (c) 2016 Paul Fultz II
0003     function_param_limit.hpp
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 
0008 #ifndef BOOST_HOF_GUARD_FUNCTION_PARAM_LIMIT_HPP
0009 #define BOOST_HOF_GUARD_FUNCTION_PARAM_LIMIT_HPP
0010 
0011 /// function_param_limit
0012 /// ====================
0013 /// 
0014 /// Description
0015 /// -----------
0016 /// 
0017 /// The `function_param_limit` metafunction retrieves the maximum number of
0018 /// parameters for a function. For function pointers it returns the number of
0019 /// parameters. Everything else, it returns `SIZE_MAX`, but this can be
0020 /// changed by annotating the function with the [`limit`](limit) decorator.
0021 /// 
0022 /// This is a type trait that inherits from `std::integral_constant`.
0023 /// 
0024 /// Synopsis
0025 /// --------
0026 /// 
0027 ///     template<class F>
0028 ///     struct function_param_limit
0029 ///     : std::integral_constant<std::size_t, ...>
0030 ///     {};
0031 /// 
0032 /// See Also
0033 /// --------
0034 /// 
0035 /// * [Partial function evaluation](<Partial function evaluation>)
0036 /// * [limit](limit)
0037 /// 
0038 
0039 #include <boost/hof/detail/holder.hpp>
0040 #include <type_traits>
0041 #include <cstdint>
0042 
0043 namespace boost { namespace hof {
0044 
0045 template<class F, class=void>
0046 struct function_param_limit
0047 : std::integral_constant<std::size_t, SIZE_MAX>
0048 {};
0049 
0050 template<class F>
0051 struct function_param_limit<F, typename detail::holder<typename F::fit_function_param_limit>::type>
0052 : F::fit_function_param_limit
0053 {};
0054 
0055 }} // namespace boost::hof
0056 
0057 #endif