blob: a7dc2a878df9f83b609430da696c9ec0eb13918b (
plain)
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
|
#ifndef TYPEASVALUE_SRC_RUNTIME_LIST_FOR_EACH_H_
#define TYPEASVALUE_SRC_RUNTIME_LIST_FOR_EACH_H_
#include <type_traits>
#include "sfinae.h"
#include "list/list.h"
namespace tav {
namespace runtime {
template <
typename Current,
typename Function,
detail::enable_if<std::is_void<Current>::value> = 0
>
void for_each(const Function&) { }
template <
typename Current,
typename Function,
detail::enable_if<!std::is_void<Current>::value> = 0
>
void for_each(const Function& function) {
function(Head<Current>::value);
for_each<Tail<Current>, Function>(function);
}
}
}
#endif // TYPEASVALUE_SRC_RUNTIME_LIST_FOR_EACH_H_
|