#ifndef CHILON_ARGUMENT_HPP
#define CHILON_ARGUMENT_HPP
#include <chilon/meta/return.hpp>
#include <chilon/meta/at.hpp>
namespace chilon {
namespace detail {
template <int I, class R>
struct argument {
template <class H, class... T>
static R exec(H&& h, T&&... t) {
return argument<I - 1, R>::exec(t...);
}
};
template <class R>
struct argument<0, R> {
template <class H, class... T>
static R exec(H&& h, T&&... t) {
return h;
}
};
}
template <int I, class... T>
auto argument(T&&... t) CHILON_RETURN(
detail::argument<
I, typename meta::at<I, T...>::type &>::exec(std::forward<T>(t)...))
template <int I, class U, class... T>
auto argument_default(U&& u, T&&... t) CHILON_RETURN(
detail::argument<
I, typename meta::at<I, T...>::type &>::exec(std::forward<T>(t)...))
template <int I, class U, class... T>
auto argument_default(U&& u, T&&... t) CHILON_RETURN(std::forward<U>(u))
}
#endif