From Jason Turner

[logical.operations]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpl7cq9i1j/{from.md → to.md} +52 -27
tmp/tmpl7cq9i1j/{from.md → to.md} RENAMED
@@ -2,70 +2,95 @@
2
 
3
  The library provides basic function object classes for all of the
4
  logical operators in the language ([[expr.log.and]], [[expr.log.or]],
5
  [[expr.unary.op]]).
6
 
 
 
7
  ``` cpp
8
  template <class T = void> struct logical_and {
9
  constexpr bool operator()(const T& x, const T& y) const;
10
- typedef T first_argument_type;
11
- typedef T second_argument_type;
12
- typedef bool result_type;
13
  };
14
  ```
15
 
16
- `operator()` returns `x && y`.
17
-
18
  ``` cpp
19
- template <class T = void> struct logical_or {
20
  constexpr bool operator()(const T& x, const T& y) const;
21
- typedef T first_argument_type;
22
- typedef T second_argument_type;
23
- typedef bool result_type;
24
- };
25
  ```
26
 
27
- `operator()` returns `x || y`.
28
-
29
- ``` cpp
30
- template <class T = void> struct logical_not {
31
- constexpr bool operator()(const T& x) const;
32
- typedef T argument_type;
33
- typedef bool result_type;
34
- };
35
- ```
36
-
37
- `operator()` returns `!x`.
38
 
39
  ``` cpp
40
  template <> struct logical_and<void> {
41
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
42
  -> decltype(std::forward<T>(t) && std::forward<U>(u));
43
 
44
- typedef unspecified is_transparent;
45
  };
46
  ```
47
 
48
- `operator()` returns `std::forward<T>(t) && std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  ``` cpp
51
  template <> struct logical_or<void> {
52
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
53
  -> decltype(std::forward<T>(t) || std::forward<U>(u));
54
 
55
- typedef unspecified is_transparent;
56
  };
57
  ```
58
 
59
- `operator()` returns `std::forward<T>(t) || std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  ``` cpp
62
  template <> struct logical_not<void> {
63
  template <class T> constexpr auto operator()(T&& t) const
64
  -> decltype(!std::forward<T>(t));
65
 
66
- typedef unspecified is_transparent;
67
  };
68
  ```
69
 
70
- `operator()` returns `!std::forward<T>(t)`.
 
 
 
 
 
71
 
 
2
 
3
  The library provides basic function object classes for all of the
4
  logical operators in the language ([[expr.log.and]], [[expr.log.or]],
5
  [[expr.unary.op]]).
6
 
7
+ #### Class template `logical_and` <a id="logical.operations.and">[[logical.operations.and]]</a>
8
+
9
  ``` cpp
10
  template <class T = void> struct logical_and {
11
  constexpr bool operator()(const T& x, const T& y) const;
 
 
 
12
  };
13
  ```
14
 
 
 
15
  ``` cpp
 
16
  constexpr bool operator()(const T& x, const T& y) const;
 
 
 
 
17
  ```
18
 
19
+ *Returns:* `x && y`.
 
 
 
 
 
 
 
 
 
 
20
 
21
  ``` cpp
22
  template <> struct logical_and<void> {
23
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
24
  -> decltype(std::forward<T>(t) && std::forward<U>(u));
25
 
26
+ using is_transparent = unspecified;
27
  };
28
  ```
29
 
30
+ ``` cpp
31
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
32
+ -> decltype(std::forward<T>(t) && std::forward<U>(u));
33
+ ```
34
+
35
+ *Returns:* `std::forward<T>(t) && std::forward<U>(u)`.
36
+
37
+ #### Class template `logical_or` <a id="logical.operations.or">[[logical.operations.or]]</a>
38
+
39
+ ``` cpp
40
+ template <class T = void> struct logical_or {
41
+ constexpr bool operator()(const T& x, const T& y) const;
42
+ };
43
+ ```
44
+
45
+ ``` cpp
46
+ constexpr bool operator()(const T& x, const T& y) const;
47
+ ```
48
+
49
+ *Returns:* `x || y`.
50
 
51
  ``` cpp
52
  template <> struct logical_or<void> {
53
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
54
  -> decltype(std::forward<T>(t) || std::forward<U>(u));
55
 
56
+ using is_transparent = unspecified;
57
  };
58
  ```
59
 
60
+ ``` cpp
61
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
62
+ -> decltype(std::forward<T>(t) || std::forward<U>(u));
63
+ ```
64
+
65
+ *Returns:* `std::forward<T>(t) || std::forward<U>(u)`.
66
+
67
+ #### Class template `logical_not` <a id="logical.operations.not">[[logical.operations.not]]</a>
68
+
69
+ ``` cpp
70
+ template <class T = void> struct logical_not {
71
+ constexpr bool operator()(const T& x) const;
72
+ };
73
+ ```
74
+
75
+ ``` cpp
76
+ constexpr bool operator()(const T& x) const;
77
+ ```
78
+
79
+ *Returns:* `!x`.
80
 
81
  ``` cpp
82
  template <> struct logical_not<void> {
83
  template <class T> constexpr auto operator()(T&& t) const
84
  -> decltype(!std::forward<T>(t));
85
 
86
+ using is_transparent = unspecified;
87
  };
88
  ```
89
 
90
+ ``` cpp
91
+ template <class T> constexpr auto operator()(T&& t) const
92
+ -> decltype(!std::forward<T>(t));
93
+ ```
94
+
95
+ *Returns:* `!std::forward<T>(t)`.
96