/*============================================================================= Copyright (c) 2011-2017 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_DETAIL_PARAM_AT_HPP #define SPROUT_DETAIL_PARAM_AT_HPP #include #include #include namespace sprout { namespace detail { template inline SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Values) == 0, R >::type param_at(std::size_t, T const& v, Values const&...) { return v; } template inline SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Values) != 0, R >::type param_at(std::size_t n, T const& v, Values const&... values) { return n == 0 ? v : sprout::detail::param_at(n - 1, values...); } template inline SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Values) == 0, R >::type param_seq_at(std::size_t, std::size_t m, T const& v, Values const&...) { return v[m]; } template inline SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Values) != 0, R >::type param_seq_at(std::size_t n, std::size_t m, T const& v, Values const&... values) { return n == 0 ? v[m] : sprout::detail::param_seq_at(n - 1, m, values...); } } // namespace detail } // namespace sprout #endif // #ifndef SPROUT_DETAIL_PARAM_AT_HPP