From Jason Turner

[negators]

Diff to HTML by rtfpessoa

tmp/tmpcuf8vi3t/{from.md → to.md} RENAMED
@@ -5,32 +5,32 @@ respectively, and return their complements ([[expr.unary.op]]).
5
 
6
  ``` cpp
7
  template <class Predicate>
8
  class unary_negate {
9
  public:
10
- explicit unary_negate(const Predicate& pred);
11
- 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
- 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
- explicit binary_negate(const Predicate& pred);
31
- 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
  };
@@ -38,10 +38,10 @@ template <class Predicate>
38
 
39
  `operator()` returns `!pred(x,y)`.
40
 
41
  ``` cpp
42
  template <class Predicate>
43
- binary_negate<Predicate> not2(const Predicate& pred);
44
  ```
45
 
46
  *Returns:* `binary_negate<Predicate>(pred)`.
47
 
 
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
  };
 
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