1 // This file was GENERATED by command:
3 // DO NOT EDIT BY HAND!!!
6 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file.
14 #include "base/bind_internal.h"
15 #include "base/callback_internal.h"
17 // See base/callback.h for how to use these functions. If reading the
18 // implementation, before proceeding further, you should read the top
19 // comment of base/bind_internal.h for a definition of common terms and
22 // IMPLEMENTATION NOTE
23 // Though Bind()'s result is meant to be stored in a Callback<> type, it
24 // cannot actually return the exact type without requiring a large amount
25 // of extra template specializations. The problem is that in order to
26 // discern the correct specialization of Callback<>, Bind would need to
27 // unwrap the function signature to determine the signature's arity, and
28 // whether or not it is a method.
30 // Each unique combination of (arity, function_type, num_prebound) where
31 // function_type is one of {function, method, const_method} would require
32 // one specialization. We eventually have to do a similar number of
33 // specializations anyways in the implementation (see the Invoker<>,
34 // classes). However, it is avoidable in Bind if we return the result
35 // via an indirection like we do below.
37 // TODO(ajwong): We might be able to avoid this now, but need to test.
39 // It is possible to move most of the COMPILE_ASSERT asserts into BindState<>,
40 // but it feels a little nicer to have the asserts here so people do not
41 // need to crack open bind_internal.h. On the other hand, it makes Bind()
46 template <typename Functor
>
47 internal::BindStateHolder
<
49 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
50 typename
internal::FunctorTraits
<Functor
>::RunType
,
52 Bind(Functor functor
) {
53 // Typedefs for how to store and run the functor.
54 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
55 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
57 // Use RunnableType::RunType instead of RunType above because our
58 // checks should below for bound references need to know what the actual
59 // functor is going to interpret the argument as.
60 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
64 return internal::MakeBindStateHolder(
65 new internal::BindState
<RunnableType
, RunType
, void()>(
66 internal::MakeRunnable(functor
)));
69 template <typename Functor
, typename P1
>
70 internal::BindStateHolder
<
72 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
73 typename
internal::FunctorTraits
<Functor
>::RunType
,
74 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
)> >
75 Bind(Functor functor
, const P1
& p1
) {
76 // Typedefs for how to store and run the functor.
77 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
78 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
80 // Use RunnableType::RunType instead of RunType above because our
81 // checks should below for bound references need to know what the actual
82 // functor is going to interpret the argument as.
83 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
86 // Do not allow binding a non-const reference parameter. Non-const reference
87 // parameters are disallowed by the Google style guide. Also, binding a
88 // non-const reference parameter can make for subtle bugs because the
89 // invoked function will receive a reference to the stored copy of the
90 // argument and not the original.
92 !(is_non_const_reference
<typename
BoundFunctorTraits::A1Type
>::value
),
93 do_not_bind_functions_with_nonconst_ref
);
95 // For methods, we need to be careful for parameter 1. We do not require
96 // a scoped_refptr because BindState<> itself takes care of AddRef() for
97 // methods. We also disallow binding of an array as the method's target
100 internal::HasIsMethodTag
<RunnableType
>::value
||
101 !internal::NeedsScopedRefptrButGetsRawPtr
<P1
>::value
,
102 p1_is_refcounted_type_and_needs_scoped_refptr
);
103 COMPILE_ASSERT(!internal::HasIsMethodTag
<RunnableType
>::value
||
104 !is_array
<P1
>::value
,
105 first_bound_argument_to_method_cannot_be_array
);
107 return internal::MakeBindStateHolder(
108 new internal::BindState
<RunnableType
, RunType
,
109 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
)>(
110 internal::MakeRunnable(functor
), p1
));
113 template <typename Functor
, typename P1
, typename P2
>
114 internal::BindStateHolder
<
116 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
117 typename
internal::FunctorTraits
<Functor
>::RunType
,
118 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
119 typename
internal::CallbackParamTraits
<P2
>::StorageType
)> >
120 Bind(Functor functor
, const P1
& p1
, const P2
& p2
) {
121 // Typedefs for how to store and run the functor.
122 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
123 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
125 // Use RunnableType::RunType instead of RunType above because our
126 // checks should below for bound references need to know what the actual
127 // functor is going to interpret the argument as.
128 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
131 // Do not allow binding a non-const reference parameter. Non-const reference
132 // parameters are disallowed by the Google style guide. Also, binding a
133 // non-const reference parameter can make for subtle bugs because the
134 // invoked function will receive a reference to the stored copy of the
135 // argument and not the original.
137 !(is_non_const_reference
<typename
BoundFunctorTraits::A1Type
>::value
||
138 is_non_const_reference
<typename
BoundFunctorTraits::A2Type
>::value
),
139 do_not_bind_functions_with_nonconst_ref
);
141 // For methods, we need to be careful for parameter 1. We do not require
142 // a scoped_refptr because BindState<> itself takes care of AddRef() for
143 // methods. We also disallow binding of an array as the method's target
146 internal::HasIsMethodTag
<RunnableType
>::value
||
147 !internal::NeedsScopedRefptrButGetsRawPtr
<P1
>::value
,
148 p1_is_refcounted_type_and_needs_scoped_refptr
);
149 COMPILE_ASSERT(!internal::HasIsMethodTag
<RunnableType
>::value
||
150 !is_array
<P1
>::value
,
151 first_bound_argument_to_method_cannot_be_array
);
152 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P2
>::value
,
153 p2_is_refcounted_type_and_needs_scoped_refptr
);
155 return internal::MakeBindStateHolder(
156 new internal::BindState
<RunnableType
, RunType
,
157 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
158 typename
internal::CallbackParamTraits
<P2
>::StorageType
)>(
159 internal::MakeRunnable(functor
), p1
, p2
));
162 template <typename Functor
, typename P1
, typename P2
, typename P3
>
163 internal::BindStateHolder
<
165 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
166 typename
internal::FunctorTraits
<Functor
>::RunType
,
167 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
168 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
169 typename
internal::CallbackParamTraits
<P3
>::StorageType
)> >
170 Bind(Functor functor
, const P1
& p1
, const P2
& p2
, const P3
& p3
) {
171 // Typedefs for how to store and run the functor.
172 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
173 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
175 // Use RunnableType::RunType instead of RunType above because our
176 // checks should below for bound references need to know what the actual
177 // functor is going to interpret the argument as.
178 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
181 // Do not allow binding a non-const reference parameter. Non-const reference
182 // parameters are disallowed by the Google style guide. Also, binding a
183 // non-const reference parameter can make for subtle bugs because the
184 // invoked function will receive a reference to the stored copy of the
185 // argument and not the original.
187 !(is_non_const_reference
<typename
BoundFunctorTraits::A1Type
>::value
||
188 is_non_const_reference
<typename
BoundFunctorTraits::A2Type
>::value
||
189 is_non_const_reference
<typename
BoundFunctorTraits::A3Type
>::value
),
190 do_not_bind_functions_with_nonconst_ref
);
192 // For methods, we need to be careful for parameter 1. We do not require
193 // a scoped_refptr because BindState<> itself takes care of AddRef() for
194 // methods. We also disallow binding of an array as the method's target
197 internal::HasIsMethodTag
<RunnableType
>::value
||
198 !internal::NeedsScopedRefptrButGetsRawPtr
<P1
>::value
,
199 p1_is_refcounted_type_and_needs_scoped_refptr
);
200 COMPILE_ASSERT(!internal::HasIsMethodTag
<RunnableType
>::value
||
201 !is_array
<P1
>::value
,
202 first_bound_argument_to_method_cannot_be_array
);
203 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P2
>::value
,
204 p2_is_refcounted_type_and_needs_scoped_refptr
);
205 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P3
>::value
,
206 p3_is_refcounted_type_and_needs_scoped_refptr
);
208 return internal::MakeBindStateHolder(
209 new internal::BindState
<RunnableType
, RunType
,
210 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
211 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
212 typename
internal::CallbackParamTraits
<P3
>::StorageType
)>(
213 internal::MakeRunnable(functor
), p1
, p2
, p3
));
216 template <typename Functor
, typename P1
, typename P2
, typename P3
, typename P4
>
217 internal::BindStateHolder
<
219 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
220 typename
internal::FunctorTraits
<Functor
>::RunType
,
221 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
222 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
223 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
224 typename
internal::CallbackParamTraits
<P4
>::StorageType
)> >
225 Bind(Functor functor
, const P1
& p1
, const P2
& p2
, const P3
& p3
, const P4
& p4
) {
226 // Typedefs for how to store and run the functor.
227 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
228 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
230 // Use RunnableType::RunType instead of RunType above because our
231 // checks should below for bound references need to know what the actual
232 // functor is going to interpret the argument as.
233 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
236 // Do not allow binding a non-const reference parameter. Non-const reference
237 // parameters are disallowed by the Google style guide. Also, binding a
238 // non-const reference parameter can make for subtle bugs because the
239 // invoked function will receive a reference to the stored copy of the
240 // argument and not the original.
242 !(is_non_const_reference
<typename
BoundFunctorTraits::A1Type
>::value
||
243 is_non_const_reference
<typename
BoundFunctorTraits::A2Type
>::value
||
244 is_non_const_reference
<typename
BoundFunctorTraits::A3Type
>::value
||
245 is_non_const_reference
<typename
BoundFunctorTraits::A4Type
>::value
),
246 do_not_bind_functions_with_nonconst_ref
);
248 // For methods, we need to be careful for parameter 1. We do not require
249 // a scoped_refptr because BindState<> itself takes care of AddRef() for
250 // methods. We also disallow binding of an array as the method's target
253 internal::HasIsMethodTag
<RunnableType
>::value
||
254 !internal::NeedsScopedRefptrButGetsRawPtr
<P1
>::value
,
255 p1_is_refcounted_type_and_needs_scoped_refptr
);
256 COMPILE_ASSERT(!internal::HasIsMethodTag
<RunnableType
>::value
||
257 !is_array
<P1
>::value
,
258 first_bound_argument_to_method_cannot_be_array
);
259 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P2
>::value
,
260 p2_is_refcounted_type_and_needs_scoped_refptr
);
261 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P3
>::value
,
262 p3_is_refcounted_type_and_needs_scoped_refptr
);
263 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P4
>::value
,
264 p4_is_refcounted_type_and_needs_scoped_refptr
);
266 return internal::MakeBindStateHolder(
267 new internal::BindState
<RunnableType
, RunType
,
268 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
269 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
270 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
271 typename
internal::CallbackParamTraits
<P4
>::StorageType
)>(
272 internal::MakeRunnable(functor
), p1
, p2
, p3
, p4
));
275 template <typename Functor
, typename P1
, typename P2
, typename P3
, typename P4
,
277 internal::BindStateHolder
<
279 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
280 typename
internal::FunctorTraits
<Functor
>::RunType
,
281 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
282 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
283 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
284 typename
internal::CallbackParamTraits
<P4
>::StorageType
,
285 typename
internal::CallbackParamTraits
<P5
>::StorageType
)> >
286 Bind(Functor functor
, const P1
& p1
, const P2
& p2
, const P3
& p3
, const P4
& p4
,
288 // Typedefs for how to store and run the functor.
289 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
290 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
292 // Use RunnableType::RunType instead of RunType above because our
293 // checks should below for bound references need to know what the actual
294 // functor is going to interpret the argument as.
295 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
298 // Do not allow binding a non-const reference parameter. Non-const reference
299 // parameters are disallowed by the Google style guide. Also, binding a
300 // non-const reference parameter can make for subtle bugs because the
301 // invoked function will receive a reference to the stored copy of the
302 // argument and not the original.
304 !(is_non_const_reference
<typename
BoundFunctorTraits::A1Type
>::value
||
305 is_non_const_reference
<typename
BoundFunctorTraits::A2Type
>::value
||
306 is_non_const_reference
<typename
BoundFunctorTraits::A3Type
>::value
||
307 is_non_const_reference
<typename
BoundFunctorTraits::A4Type
>::value
||
308 is_non_const_reference
<typename
BoundFunctorTraits::A5Type
>::value
),
309 do_not_bind_functions_with_nonconst_ref
);
311 // For methods, we need to be careful for parameter 1. We do not require
312 // a scoped_refptr because BindState<> itself takes care of AddRef() for
313 // methods. We also disallow binding of an array as the method's target
316 internal::HasIsMethodTag
<RunnableType
>::value
||
317 !internal::NeedsScopedRefptrButGetsRawPtr
<P1
>::value
,
318 p1_is_refcounted_type_and_needs_scoped_refptr
);
319 COMPILE_ASSERT(!internal::HasIsMethodTag
<RunnableType
>::value
||
320 !is_array
<P1
>::value
,
321 first_bound_argument_to_method_cannot_be_array
);
322 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P2
>::value
,
323 p2_is_refcounted_type_and_needs_scoped_refptr
);
324 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P3
>::value
,
325 p3_is_refcounted_type_and_needs_scoped_refptr
);
326 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P4
>::value
,
327 p4_is_refcounted_type_and_needs_scoped_refptr
);
328 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P5
>::value
,
329 p5_is_refcounted_type_and_needs_scoped_refptr
);
331 return internal::MakeBindStateHolder(
332 new internal::BindState
<RunnableType
, RunType
,
333 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
334 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
335 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
336 typename
internal::CallbackParamTraits
<P4
>::StorageType
,
337 typename
internal::CallbackParamTraits
<P5
>::StorageType
)>(
338 internal::MakeRunnable(functor
), p1
, p2
, p3
, p4
, p5
));
341 template <typename Functor
, typename P1
, typename P2
, typename P3
, typename P4
,
342 typename P5
, typename P6
>
343 internal::BindStateHolder
<
345 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
346 typename
internal::FunctorTraits
<Functor
>::RunType
,
347 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
348 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
349 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
350 typename
internal::CallbackParamTraits
<P4
>::StorageType
,
351 typename
internal::CallbackParamTraits
<P5
>::StorageType
,
352 typename
internal::CallbackParamTraits
<P6
>::StorageType
)> >
353 Bind(Functor functor
, const P1
& p1
, const P2
& p2
, const P3
& p3
, const P4
& p4
,
354 const P5
& p5
, const P6
& p6
) {
355 // Typedefs for how to store and run the functor.
356 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
357 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
359 // Use RunnableType::RunType instead of RunType above because our
360 // checks should below for bound references need to know what the actual
361 // functor is going to interpret the argument as.
362 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
365 // Do not allow binding a non-const reference parameter. Non-const reference
366 // parameters are disallowed by the Google style guide. Also, binding a
367 // non-const reference parameter can make for subtle bugs because the
368 // invoked function will receive a reference to the stored copy of the
369 // argument and not the original.
371 !(is_non_const_reference
<typename
BoundFunctorTraits::A1Type
>::value
||
372 is_non_const_reference
<typename
BoundFunctorTraits::A2Type
>::value
||
373 is_non_const_reference
<typename
BoundFunctorTraits::A3Type
>::value
||
374 is_non_const_reference
<typename
BoundFunctorTraits::A4Type
>::value
||
375 is_non_const_reference
<typename
BoundFunctorTraits::A5Type
>::value
||
376 is_non_const_reference
<typename
BoundFunctorTraits::A6Type
>::value
),
377 do_not_bind_functions_with_nonconst_ref
);
379 // For methods, we need to be careful for parameter 1. We do not require
380 // a scoped_refptr because BindState<> itself takes care of AddRef() for
381 // methods. We also disallow binding of an array as the method's target
384 internal::HasIsMethodTag
<RunnableType
>::value
||
385 !internal::NeedsScopedRefptrButGetsRawPtr
<P1
>::value
,
386 p1_is_refcounted_type_and_needs_scoped_refptr
);
387 COMPILE_ASSERT(!internal::HasIsMethodTag
<RunnableType
>::value
||
388 !is_array
<P1
>::value
,
389 first_bound_argument_to_method_cannot_be_array
);
390 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P2
>::value
,
391 p2_is_refcounted_type_and_needs_scoped_refptr
);
392 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P3
>::value
,
393 p3_is_refcounted_type_and_needs_scoped_refptr
);
394 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P4
>::value
,
395 p4_is_refcounted_type_and_needs_scoped_refptr
);
396 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P5
>::value
,
397 p5_is_refcounted_type_and_needs_scoped_refptr
);
398 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P6
>::value
,
399 p6_is_refcounted_type_and_needs_scoped_refptr
);
401 return internal::MakeBindStateHolder(
402 new internal::BindState
<RunnableType
, RunType
,
403 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
404 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
405 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
406 typename
internal::CallbackParamTraits
<P4
>::StorageType
,
407 typename
internal::CallbackParamTraits
<P5
>::StorageType
,
408 typename
internal::CallbackParamTraits
<P6
>::StorageType
)>(
409 internal::MakeRunnable(functor
), p1
, p2
, p3
, p4
, p5
, p6
));
412 template <typename Functor
, typename P1
, typename P2
, typename P3
, typename P4
,
413 typename P5
, typename P6
, typename P7
>
414 internal::BindStateHolder
<
416 typename
internal::FunctorTraits
<Functor
>::RunnableType
,
417 typename
internal::FunctorTraits
<Functor
>::RunType
,
418 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
419 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
420 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
421 typename
internal::CallbackParamTraits
<P4
>::StorageType
,
422 typename
internal::CallbackParamTraits
<P5
>::StorageType
,
423 typename
internal::CallbackParamTraits
<P6
>::StorageType
,
424 typename
internal::CallbackParamTraits
<P7
>::StorageType
)> >
425 Bind(Functor functor
, const P1
& p1
, const P2
& p2
, const P3
& p3
, const P4
& p4
,
426 const P5
& p5
, const P6
& p6
, const P7
& p7
) {
427 // Typedefs for how to store and run the functor.
428 typedef typename
internal::FunctorTraits
<Functor
>::RunnableType RunnableType
;
429 typedef typename
internal::FunctorTraits
<Functor
>::RunType RunType
;
431 // Use RunnableType::RunType instead of RunType above because our
432 // checks should below for bound references need to know what the actual
433 // functor is going to interpret the argument as.
434 typedef internal::FunctionTraits
<typename
RunnableType::RunType
>
437 // Do not allow binding a non-const reference parameter. Non-const reference
438 // parameters are disallowed by the Google style guide. Also, binding a
439 // non-const reference parameter can make for subtle bugs because the
440 // invoked function will receive a reference to the stored copy of the
441 // argument and not the original.
443 !(is_non_const_reference
<typename
BoundFunctorTraits::A1Type
>::value
||
444 is_non_const_reference
<typename
BoundFunctorTraits::A2Type
>::value
||
445 is_non_const_reference
<typename
BoundFunctorTraits::A3Type
>::value
||
446 is_non_const_reference
<typename
BoundFunctorTraits::A4Type
>::value
||
447 is_non_const_reference
<typename
BoundFunctorTraits::A5Type
>::value
||
448 is_non_const_reference
<typename
BoundFunctorTraits::A6Type
>::value
||
449 is_non_const_reference
<typename
BoundFunctorTraits::A7Type
>::value
),
450 do_not_bind_functions_with_nonconst_ref
);
452 // For methods, we need to be careful for parameter 1. We do not require
453 // a scoped_refptr because BindState<> itself takes care of AddRef() for
454 // methods. We also disallow binding of an array as the method's target
457 internal::HasIsMethodTag
<RunnableType
>::value
||
458 !internal::NeedsScopedRefptrButGetsRawPtr
<P1
>::value
,
459 p1_is_refcounted_type_and_needs_scoped_refptr
);
460 COMPILE_ASSERT(!internal::HasIsMethodTag
<RunnableType
>::value
||
461 !is_array
<P1
>::value
,
462 first_bound_argument_to_method_cannot_be_array
);
463 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P2
>::value
,
464 p2_is_refcounted_type_and_needs_scoped_refptr
);
465 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P3
>::value
,
466 p3_is_refcounted_type_and_needs_scoped_refptr
);
467 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P4
>::value
,
468 p4_is_refcounted_type_and_needs_scoped_refptr
);
469 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P5
>::value
,
470 p5_is_refcounted_type_and_needs_scoped_refptr
);
471 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P6
>::value
,
472 p6_is_refcounted_type_and_needs_scoped_refptr
);
473 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr
<P7
>::value
,
474 p7_is_refcounted_type_and_needs_scoped_refptr
);
476 return internal::MakeBindStateHolder(
477 new internal::BindState
<RunnableType
, RunType
,
478 void(typename
internal::CallbackParamTraits
<P1
>::StorageType
,
479 typename
internal::CallbackParamTraits
<P2
>::StorageType
,
480 typename
internal::CallbackParamTraits
<P3
>::StorageType
,
481 typename
internal::CallbackParamTraits
<P4
>::StorageType
,
482 typename
internal::CallbackParamTraits
<P5
>::StorageType
,
483 typename
internal::CallbackParamTraits
<P6
>::StorageType
,
484 typename
internal::CallbackParamTraits
<P7
>::StorageType
)>(
485 internal::MakeRunnable(functor
), p1
, p2
, p3
, p4
, p5
, p6
, p7
));
490 #endif // BASE_BIND_H_