aboutsummaryrefslogtreecommitdiff
path: root/src/conditional/cond.h
blob: eeb31b60e1d999d458bfef6083b308bc0e3dbdf5 (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
#ifndef TYPEASVALUE_SRC_CONDITIONAL_COND_H_
#define TYPEASVALUE_SRC_CONDITIONAL_COND_H_

#include <type_traits>

#include "list/list.h"
#include "list/operation/higher/find.h"

namespace tav {

namespace detail {

template <typename Pair>
using cond_predicate = IsTrue<Car<Pair>>;

}

template <typename... Branches>
using Cond = Cdr<
	Find<
		detail::cond_predicate,
		List<Branches...>
	>
>;

}

#endif  // TYPEASVALUE_SRC_CONDITIONAL_COND_H_