File: interface.qbk

package info (click to toggle)
boost1.83 1.83.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 545,632 kB
  • sloc: cpp: 3,857,086; xml: 125,552; ansic: 34,414; python: 25,887; asm: 5,276; sh: 4,799; ada: 1,681; makefile: 1,629; perl: 1,212; pascal: 1,139; sql: 810; yacc: 478; ruby: 102; lisp: 24; csh: 6
file content (216 lines) | stat: -rw-r--r-- 7,246 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
[/
 /  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
 /  Copyright (c) 2003-2008 Peter Dimov
 /
 / Distributed under the Boost Software License, Version 1.0. (See
 / accompanying file LICENSE_1_0.txt or copy at
 / http://www.boost.org/LICENSE_1_0.txt)
 /]

[section:interface Interface]

[section:synopsys Synopsis]

    namespace boost
    {
    // no arguments

    template<class R, class F> ``/unspecified-1/`` ``[link bind_1 `bind`]``(F f);

    template<class F> ``/unspecified-1-1/`` ``[link bind_1_1 `bind`]``(F f);

    template<class R> ``/unspecified-2/`` ``[link bind_2 `bind`]``(R (*f) ());

    // one argument

    template<class R, class F, class A1> ``/unspecified-3/`` ``[link bind_3 `bind`]``(F f, A1 a1);

    template<class F, class A1> ``/unspecified-3-1/`` ``[link bind_3_1 `bind`]``(F f, A1 a1);

    template<class R, class B1, class A1> ``/unspecified-4/`` ``[link bind_4 `bind`]``(R (*f) (B1), A1 a1);

    template<class R, class T, class A1> ``/unspecified-5/`` ``[link bind_5 `bind`]``(R (T::*f) (), A1 a1);

    template<class R, class T, class A1> ``/unspecified-6/`` ``[link bind_6 `bind`]``(R (T::*f) () const, A1 a1);

    template<class R, class T, class A1> ``/unspecified-6-1/`` ``[link bind_6_1 `bind`]``(R T::*f, A1 a1);

    // two arguments

    template<class R, class F, class A1, class A2> ``/unspecified-7/`` ``[link bind_7 `bind`]``(F f, A1 a1, A2 a2);

    template<class F, class A1, class A2> ``/unspecified-7-1/`` ``[link bind_7_1 `bind`]``(F f, A1 a1, A2 a2);

    template<class R, class B1, class B2, class A1, class A2> ``/unspecified-8/`` ``[link bind_8 `bind`]``(R (*f) (B1, B2), A1 a1, A2 a2);

    template<class R, class T, class B1, class A1, class A2> ``/unspecified-9/`` ``[link bind_9 `bind`]``(R (T::*f) (B1), A1 a1, A2 a2);

    template<class R, class T, class B1, class A1, class A2> ``/unspecified-10/`` ``[link bind_10 `bind`]``(R (T::*f) (B1) const, A1 a1, A2 a2);

    // implementation defined number of additional overloads for more arguments
    }

    namespace
    {
     ``/unspecified-placeholder-type-1/`` _1;

     ``/unspecified-placeholder-type-2/`` _2;

     ``/unspecified-placeholder-type-3/`` _3;

    // implementation defined number of additional placeholder definitions
    }

[endsect]

[section Common requirements]

All /unspecified-N/ types returned by `bind` are /CopyConstructible/. /unspecified-N/`::result_type` is defined as the return type of /unspecified-N/`::operator()`.

All /unspecified-placeholder-N/ types are /CopyConstructible/. Their copy constructors do not throw exceptions.

[endsect]

[section Common definitions]

The function \u03BC`(x, v1, v2, ..., vm)`, where `m` is a nonnegative integer, is
defined as:

* `x.get()`, when `x` is of type [@boost:/libs/core/doc/html/core/ref.html `boost::reference_wrapper`]`<T>` for some type
  `T`;

* `vk`, when `x` is (a copy of) the placeholder /_k/ for some positive integer
  /k/;

* `x(v1, v2, ..., vm)` when `x` is (a copy of) a function object returned by
  `bind`;

* `x` otherwise.

[endsect]

[section `bind`]

[#bind_1]

    template<class R, class F> ``/unspecified-1/`` bind(F f)

* /Returns:/ A function object \u03BB such that the expression \u03BB`(v1, v2, ..., vm)`
is equivalent to `f()`, implicitly converted to `R`.

* /Throws:/ Nothing unless the copy constructor of `F` throws an exception.

[#bind_1_1]

    template<class F> ``/unspecified-1-1/`` bind(F f)

* /Effects:/ Equivalent to `bind<typename F::result_type, F>(f)`.

* /Notes:/ Implementations are allowed to infer the return type of `f` via other
means as an extension, without relying on the `result_type` member.

[#bind_2]

    template<class R> ``/unspecified-2/`` bind(R (*f) ())

* /Returns:/ A function object \u03BB such that the expression \u03BB`(v1, v2, ..., vm)`
is equivalent to `f()`.

* /Throws:/ Nothing.

[#bind_3]

    template<class R, class F, class A1> ``/unspecified-3/`` bind(F f, A1 a1)

* /Returns:/ A function object \u03BB such that the expression \u03BB`(v1, v2, ..., vm)`
is equivalent to `f(`\u03BC`(a1, v1, v2, ..., vm))`, implicitly converted to `R`.

* /Throws:/ Nothing unless the copy constructors of `F` or `A1` throw an exception.

[#bind_3_1]

    template<class F, class A1> ``/unspecified-3-1/`` bind(F f, A1 a1)

* /Effects:/ Equivalent to `bind<typename F::result_type, F, A1>(f, a1)`.

* /Notes:/ Implementations are allowed to infer the return type of `f` via other
means as an extension, without relying on the `result_type` member.

[#bind_4]

    template<class R, class B1, class A1> ``/unspecified-4/`` bind(R (*f) (B1), A1 a1)

* /Returns:/ A function object \u03BB such that the expression \u03BB`(v1, v2, ..., vm)`
is equivalent to `f(`\u03BC`(a1, v1, v2, ..., vm))`.

* /Throws:/ Nothing unless the copy constructor of `A1` throws an exception.

[#bind_5]

    template<class R, class T, class A1> ``/unspecified-5/`` bind(R (T::*f) (), A1 a1)

* /Effects:/ Equivalent to `bind<R>(`[@boost:/libs/bind/mem_fn.html `boost::mem_fn`]`(f), a1)`.

[#bind_6]

    template<class R, class T, class A1> ``/unspecified-6/`` bind(R (T::*f) () const, A1 a1)

* /Effects:/ Equivalent to `bind<R>(`[@boost:/libs/bind/mem_fn.html `boost::mem_fn`]`(f), a1)`.

[#bind_6_1]

    template<class R, class T, class A1> ``/unspecified-6-1/`` bind(R T::*f, A1 a1)

* /Effects:/ Equivalent to `bind<R>(`[@boost:/libs/bind/mem_fn.html `boost::mem_fn`]`(f), a1)`.

[#bind_7]

    template<class R, class F, class A1, class A2> ``/unspecified-7/`` bind(F f, A1 a1, A2 a2)

* /Returns:/ A function object \u03BB such that the expression \u03BB`(v1, v2, ..., vm)`
is equivalent to `f(`\u03BC`(a1, v1, v2, ..., vm), `\u03BC`(a2, v1, v2, ..., vm))`,
implicitly converted to `R`.

* /Throws:/ Nothing unless the copy constructors of `F`, `A1` or `A2` throw an
exception.

[#bind_7_1]

    template<class F, class A1, class A2> ``/unspecified-7-1/`` bind(F f, A1 a1, A2 a2)

* /Effects:/ Equivalent to `bind<typename F::result_type, F, A1, A2>(f, a1, a2)`.

* /Notes:/ Implementations are allowed to infer the return type of `f` via other
means as an extension, without relying on the `result_type` member.

[#bind_8]

    template<class R, class B1, class B2, class A1, class A2> ``/unspecified-8/`` bind(R (*f) (B1, B2), A1 a1, A2 a2)

* /Returns:/ A function object \u03BB such that the expression \u03BB`(v1, v2, ..., vm)`
is equivalent to `f(`\u03BC`(a1, v1, v2, ..., vm), `\u03BC`(a2, v1, v2, ..., vm))`.

* /Throws:/ Nothing unless the copy constructors of `A1` or `A2` throw an exception.

[#bind_9]

    template<class R, class T, class B1, class A1, class A2> ``/unspecified-9/`` bind(R (T::*f) (B1), A1 a1, A2 a2)

* /Effects:/ Equivalent to `bind<R>(`[@boost:/libs/bind/mem_fn.html `boost::mem_fn`]`(f), a1, a2)`.

[#bind_10]

    template<class R, class T, class B1, class A1, class A2> ``/unspecified-10/`` bind(R (T::*f) (B1) const, A1 a1, A2 a2)

* /Effects:/ Equivalent to `bind<R>(`[@boost:/libs/bind/mem_fn.html `boost::mem_fn`]`(f), a1, a2)`.

[endsect]

[section Additional overloads]

Implementations are allowed to provide additional `bind` overloads in order to
support more arguments or different function pointer variations.

[endsect]

[endsect]