From Jason Turner

[negators]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpq968loo3/{from.md → to.md} +0 -47
tmp/tmpq968loo3/{from.md → to.md} RENAMED
@@ -1,47 +0,0 @@
1
- ### Negators <a id="negators">[[negators]]</a>
2
-
3
- Negators `not1` and `not2` take a unary and a binary predicate,
4
- respectively, and return their complements ([[expr.unary.op]]).
5
-
6
- ``` cpp
7
- template <class Predicate>
8
- class unary_negate {
9
- public:
10
- constexpr explicit unary_negate(const Predicate& pred);
11
- constexpr bool operator()(const typename Predicate::argument_type& x) const;
12
- typedef typename Predicate::argument_type argument_type;
13
- typedef bool result_type;
14
- };
15
- ```
16
-
17
- `operator()` returns `!pred(x)`.
18
-
19
- ``` cpp
20
- template <class Predicate>
21
- constexpr unary_negate<Predicate> not1(const Predicate& pred);
22
- ```
23
-
24
- *Returns:* `unary_negate<Predicate>(pred)`.
25
-
26
- ``` cpp
27
- template <class Predicate>
28
- class binary_negate {
29
- public:
30
- constexpr explicit binary_negate(const Predicate& pred);
31
- constexpr bool operator()(const typename Predicate::first_argument_type& x,
32
- const typename Predicate::second_argument_type& y) const;
33
- typedef typename Predicate::first_argument_type first_argument_type;
34
- typedef typename Predicate::second_argument_type second_argument_type;
35
- typedef bool result_type;
36
- };
37
- ```
38
-
39
- `operator()` returns `!pred(x,y)`.
40
-
41
- ``` cpp
42
- template <class Predicate>
43
- constexpr binary_negate<Predicate> not2(const Predicate& pred);
44
- ```
45
-
46
- *Returns:* `binary_negate<Predicate>(pred)`.
47
-