arg

Description

The arg function returns a function object that returns the Nth argument passed to it. It actually starts at 1, so it is not the zero-based index of the argument.

Synopsis

template<class IntegralConstant>
constexpr auto arg(IntegralConstant);

template<std::size_t N, class... Ts>
constexpr auto arg_c(Ts&&...);

Example

#include <boost/hof.hpp>
#include <cassert>
using namespace boost::hof;

int main() {
    assert(arg(std::integral_constant<int, 3>())(1,2,3,4,5) == 3);
}