Menu

[94f52a]: / argument.hpp  Maximize  Restore  History

Download this file

42 lines (33 with data), 1.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#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
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.