blob: 7f54eb5be275da018052ba6f4b07d820b229f689 (
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
36
37
38
|
#ifndef TYPEASVALUE_SRC_LIST_CONS_H_
#define TYPEASVALUE_SRC_LIST_CONS_H_
#include "pair.h"
namespace tav {
template <
typename CAR,
typename CDR
>
struct Cons {
typedef Pair<CAR, CDR> type;
};
template <typename Pair>
struct Car {
static_assert(
IsPair<Pair>::type::value,
"Pair type required"
);
typedef typename Pair::car type;
};
template <typename Pair>
struct Cdr {
static_assert(
IsPair<Pair>::type::value,
"Pair type required"
);
typedef typename Pair::cdr type;
};
}
#endif // TYPEASVALUE_SRC_LIST_CONS_H_
|