73ef4ff3
Hu Chunming
提交三方库
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
[#predicate]
[section Predicate]
A ['predicate] (or unary predicate) is a
[link metafunction_class template metafunction class] taking one argument and
returning a [link boxed_value boxed value] of type `bool`.
For example the following predicate checks if its argument is the boxed `char`
value `x`:
struct is_x
{
template <class C>
struct apply
{
static constexpr bool value = (C::value == 'x');
using type = apply;
};
using type = is_x;
};
[endsect]
|