From Jason Turner

[functional.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpir39wyox/{from.md → to.md} +158 -0
tmp/tmpir39wyox/{from.md → to.md} RENAMED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Header `<functional>` synopsis <a id="functional.syn">[[functional.syn]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ // [func.invoke], invoke
6
+ template <class F, class... Args>
7
+ invoke_result_t<F, Args...> invoke(F&& f, Args&&... args)
8
+ noexcept(is_nothrow_invocable_v<F, Args...>);
9
+
10
+ // [refwrap], reference_wrapper
11
+ template <class T> class reference_wrapper;
12
+
13
+ template <class T> reference_wrapper<T> ref(T&) noexcept;
14
+ template <class T> reference_wrapper<const T> cref(const T&) noexcept;
15
+ template <class T> void ref(const T&&) = delete;
16
+ template <class T> void cref(const T&&) = delete;
17
+
18
+ template <class T> reference_wrapper<T> ref(reference_wrapper<T>) noexcept;
19
+ template <class T> reference_wrapper<const T> cref(reference_wrapper<T>) noexcept;
20
+
21
+ // [arithmetic.operations], arithmetic operations
22
+ template <class T = void> struct plus;
23
+ template <class T = void> struct minus;
24
+ template <class T = void> struct multiplies;
25
+ template <class T = void> struct divides;
26
+ template <class T = void> struct modulus;
27
+ template <class T = void> struct negate;
28
+ template <> struct plus<void>;
29
+ template <> struct minus<void>;
30
+ template <> struct multiplies<void>;
31
+ template <> struct divides<void>;
32
+ template <> struct modulus<void>;
33
+ template <> struct negate<void>;
34
+
35
+ // [comparisons], comparisons
36
+ template <class T = void> struct equal_to;
37
+ template <class T = void> struct not_equal_to;
38
+ template <class T = void> struct greater;
39
+ template <class T = void> struct less;
40
+ template <class T = void> struct greater_equal;
41
+ template <class T = void> struct less_equal;
42
+ template <> struct equal_to<void>;
43
+ template <> struct not_equal_to<void>;
44
+ template <> struct greater<void>;
45
+ template <> struct less<void>;
46
+ template <> struct greater_equal<void>;
47
+ template <> struct less_equal<void>;
48
+
49
+ // [logical.operations], logical operations
50
+ template <class T = void> struct logical_and;
51
+ template <class T = void> struct logical_or;
52
+ template <class T = void> struct logical_not;
53
+ template <> struct logical_and<void>;
54
+ template <> struct logical_or<void>;
55
+ template <> struct logical_not<void>;
56
+
57
+ // [bitwise.operations], bitwise operations
58
+ template <class T = void> struct bit_and;
59
+ template <class T = void> struct bit_or;
60
+ template <class T = void> struct bit_xor;
61
+ template <class T = void> struct bit_not;
62
+ template <> struct bit_and<void>;
63
+ template <> struct bit_or<void>;
64
+ template <> struct bit_xor<void>;
65
+ template <> struct bit_not<void>;
66
+
67
+ // [func.not_fn], function template not_fn
68
+ template <class F>
69
+ unspecified not_fn(F&& f);
70
+
71
+ // [func.bind], bind
72
+ template<class T> struct is_bind_expression;
73
+ template<class T> struct is_placeholder;
74
+
75
+ template<class F, class... BoundArgs>
76
+ unspecified bind(F&&, BoundArgs&&...);
77
+ template<class R, class F, class... BoundArgs>
78
+ unspecified bind(F&&, BoundArgs&&...);
79
+
80
+ namespace placeholders {
81
+ // M is the implementation-defined number of placeholders
82
+ see belownc _1;
83
+ see belownc _2;
84
+ .
85
+ .
86
+ .
87
+ see belownc _M;
88
+ }
89
+
90
+ // [func.memfn], member function adaptors
91
+ template<class R, class T>
92
+ unspecified mem_fn(R T::*) noexcept;
93
+
94
+ // [func.wrap], polymorphic function wrappers
95
+ class bad_function_call;
96
+
97
+ template<class> class function; // not defined
98
+ template<class R, class... ArgTypes> class function<R(ArgTypes...)>;
99
+
100
+ template<class R, class... ArgTypes>
101
+ void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&) noexcept;
102
+
103
+ template<class R, class... ArgTypes>
104
+ bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
105
+ template<class R, class... ArgTypes>
106
+ bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
107
+ template<class R, class... ArgTypes>
108
+ bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
109
+ template<class R, class... ArgTypes>
110
+ bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
111
+
112
+ // [func.search], searchers
113
+ template<class ForwardIterator, class BinaryPredicate = equal_to<>>
114
+ class default_searcher;
115
+
116
+ template<class RandomAccessIterator,
117
+ class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
118
+ class BinaryPredicate = equal_to<>>
119
+ class boyer_moore_searcher;
120
+
121
+ template<class RandomAccessIterator,
122
+ class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
123
+ class BinaryPredicate = equal_to<>>
124
+ class boyer_moore_horspool_searcher;
125
+
126
+ // [unord.hash], hash function primary template
127
+ template <class T>
128
+ struct hash;
129
+
130
+ // [func.bind], function object binders
131
+ template <class T>
132
+ inline constexpr bool is_bind_expression_v = is_bind_expression<T>::value;
133
+ template <class T>
134
+ inline constexpr int is_placeholder_v = is_placeholder<T>::value;
135
+ }
136
+ ```
137
+
138
+ [*Example 1*:
139
+
140
+ If a C++program wants to have a by-element addition of two vectors `a`
141
+ and `b` containing `double` and put the result into `a`, it can do:
142
+
143
+ ``` cpp
144
+ transform(a.begin(), a.end(), b.begin(), a.begin(), plus<double>());
145
+ ```
146
+
147
+ — *end example*]
148
+
149
+ [*Example 2*:
150
+
151
+ To negate every element of `a`:
152
+
153
+ ``` cpp
154
+ transform(a.begin(), a.end(), a.begin(), negate<double>());
155
+ ```
156
+
157
+ — *end example*]
158
+