]> git.lyx.org Git - lyx.git/blob - boost/boost/function/function_template.hpp
update boost to version 1.29.0
[lyx.git] / boost / boost / function / function_template.hpp
1 // Boost.Function library
2
3 // Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
4 //
5 // Permission to copy, use, sell and distribute this software is granted
6 // provided this copyright notice appears in all copies.
7 // Permission to modify the code and to distribute modified code is granted
8 // provided this copyright notice appears in all copies, and a notice
9 // that the code was modified is included with the copyright notice.
10 //
11 // This software is provided "as is" without express or implied warranty,
12 // and with no claim as to its suitability for any purpose.
13
14 // For more information, see http://www.boost.org
15
16 // Note: this header is a header template and must NOT have multiple-inclusion
17 // protection. 
18
19 #ifndef BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
20 #define BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
21 #  include <cassert>
22 #  include <algorithm>
23 #  include <boost/config.hpp>
24 #  include <boost/function/function_base.hpp>
25 #  include <boost/mem_fn.hpp>
26 #endif // BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
27
28 // Type of the default allocator
29 #ifndef BOOST_NO_STD_ALLOCATOR
30 #  define BOOST_FUNCTION_DEFAULT_ALLOCATOR std::allocator<function_base>
31 #else
32 #  define BOOST_FUNCTION_DEFAULT_ALLOCATOR int
33 #endif // BOOST_NO_STD_ALLOCATOR
34
35 // Comma if nonzero number of arguments
36 #if BOOST_FUNCTION_NUM_ARGS == 0
37 #  define BOOST_FUNCTION_COMMA 
38 #else
39 #  define BOOST_FUNCTION_COMMA ,
40 #endif // BOOST_FUNCTION_NUM_ARGS > 0
41
42 // Class names used in this version of the code
43 #define BOOST_FUNCTION_FUNCTION BOOST_JOIN(function,BOOST_FUNCTION_NUM_ARGS)
44 #define BOOST_FUNCTION_FUNCTION_INVOKER \
45   BOOST_JOIN(function_invoker,BOOST_FUNCTION_NUM_ARGS)
46 #define BOOST_FUNCTION_VOID_FUNCTION_INVOKER \
47   BOOST_JOIN(void_function_invoker,BOOST_FUNCTION_NUM_ARGS) 
48 #define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER \
49   BOOST_JOIN(function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
50 #define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER \
51   BOOST_JOIN(void_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
52 #define BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER \
53   BOOST_JOIN(stateless_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
54 #define BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER \
55   BOOST_JOIN(stateless_void_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
56 #define BOOST_FUNCTION_GET_FUNCTION_INVOKER \
57   BOOST_JOIN(get_function_invoker,BOOST_FUNCTION_NUM_ARGS)
58 #define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER \
59   BOOST_JOIN(get_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
60 #define BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER \
61   BOOST_JOIN(get_stateless_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
62
63 namespace boost {
64   namespace detail {
65     namespace function {
66       template<
67         typename FunctionPtr,
68         typename R BOOST_FUNCTION_COMMA
69         BOOST_FUNCTION_TEMPLATE_PARMS
70         >
71       struct BOOST_FUNCTION_FUNCTION_INVOKER
72       {
73         static R invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
74                         BOOST_FUNCTION_PARMS)
75         {
76           FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
77           return f(BOOST_FUNCTION_ARGS);
78         }
79       };
80
81       template<
82         typename FunctionPtr,
83         typename R BOOST_FUNCTION_COMMA
84         BOOST_FUNCTION_TEMPLATE_PARMS
85         >
86       struct BOOST_FUNCTION_VOID_FUNCTION_INVOKER
87       {
88         static unusable invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
89                                BOOST_FUNCTION_PARMS)
90
91         {
92           FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
93           f(BOOST_FUNCTION_ARGS);
94           return unusable();
95         }
96       };
97
98       template<
99         typename FunctionObj,
100         typename R BOOST_FUNCTION_COMMA
101         BOOST_FUNCTION_TEMPLATE_PARMS
102       >
103       struct BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
104       {
105         static R invoke(any_pointer function_obj_ptr BOOST_FUNCTION_COMMA
106                         BOOST_FUNCTION_PARMS)
107
108         {
109           FunctionObj* f = (FunctionObj*)(function_obj_ptr.obj_ptr);
110           return (*f)(BOOST_FUNCTION_ARGS);
111         }
112       };
113
114       template<
115         typename FunctionObj,
116         typename R BOOST_FUNCTION_COMMA
117         BOOST_FUNCTION_TEMPLATE_PARMS
118       >
119       struct BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
120       {
121         static unusable invoke(any_pointer function_obj_ptr 
122                                BOOST_FUNCTION_COMMA
123                                BOOST_FUNCTION_PARMS)
124
125         {
126           FunctionObj* f = (FunctionObj*)(function_obj_ptr.obj_ptr);
127           (*f)(BOOST_FUNCTION_ARGS);
128           return unusable();
129         }
130       };
131
132       template<
133         typename FunctionObj,
134         typename R BOOST_FUNCTION_COMMA
135         BOOST_FUNCTION_TEMPLATE_PARMS
136       >
137       struct BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER
138       {
139         static R invoke(any_pointer BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS)
140         {
141           FunctionObj f = FunctionObj();
142           return f(BOOST_FUNCTION_ARGS);
143         }
144       };
145
146       template<
147         typename FunctionObj,
148         typename R BOOST_FUNCTION_COMMA
149         BOOST_FUNCTION_TEMPLATE_PARMS
150       >
151       struct BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER
152       {
153         static unusable invoke(any_pointer BOOST_FUNCTION_COMMA 
154                                BOOST_FUNCTION_PARMS)
155
156         {
157           FunctionObj f = FunctionObj();
158           f(BOOST_FUNCTION_ARGS);
159           return unusable();
160         }
161       };
162
163       template<
164         typename FunctionPtr,
165         typename R BOOST_FUNCTION_COMMA
166         BOOST_FUNCTION_TEMPLATE_PARMS
167       >
168       struct BOOST_FUNCTION_GET_FUNCTION_INVOKER
169       {
170         typedef typename ct_if<(is_void<R>::value),
171                             BOOST_FUNCTION_VOID_FUNCTION_INVOKER<
172                             FunctionPtr,
173                             R BOOST_FUNCTION_COMMA
174                             BOOST_FUNCTION_TEMPLATE_ARGS
175                           >,
176                           BOOST_FUNCTION_FUNCTION_INVOKER<
177                             FunctionPtr,
178                             R BOOST_FUNCTION_COMMA
179                             BOOST_FUNCTION_TEMPLATE_ARGS
180                           >
181                        >::type type;
182       };
183
184       template<
185         typename FunctionObj,
186         typename R BOOST_FUNCTION_COMMA
187         BOOST_FUNCTION_TEMPLATE_PARMS
188        >
189       struct BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
190       {
191         typedef typename ct_if<(is_void<R>::value),
192                             BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER<
193                             FunctionObj,
194                             R BOOST_FUNCTION_COMMA
195                             BOOST_FUNCTION_TEMPLATE_ARGS
196                           >,
197                           BOOST_FUNCTION_FUNCTION_OBJ_INVOKER<
198                             FunctionObj,
199                             R BOOST_FUNCTION_COMMA
200                             BOOST_FUNCTION_TEMPLATE_ARGS
201                           >
202                        >::type type;
203       };
204
205       template<
206         typename FunctionObj,
207         typename R BOOST_FUNCTION_COMMA
208         BOOST_FUNCTION_TEMPLATE_PARMS
209        >
210       struct BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER
211       {
212         typedef typename ct_if<(is_void<R>::value),
213                             BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER<
214                             FunctionObj,
215                             R BOOST_FUNCTION_COMMA
216                             BOOST_FUNCTION_TEMPLATE_ARGS
217                           >,
218                           BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER<
219                             FunctionObj,
220                             R BOOST_FUNCTION_COMMA
221                             BOOST_FUNCTION_TEMPLATE_ARGS
222                           >
223                        >::type type;
224       };
225
226     } // end namespace function
227   } // end namespace detail
228
229   template<
230     typename R BOOST_FUNCTION_COMMA
231     BOOST_FUNCTION_TEMPLATE_PARMS,
232 #ifndef BOOST_FUNCTION_NO_DEPRECATED
233     typename Policy    = empty_function_policy,
234     typename Mixin     = empty_function_mixin,
235 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
236     typename Allocator = BOOST_FUNCTION_DEFAULT_ALLOCATOR
237   >
238   class BOOST_FUNCTION_FUNCTION : public function_base
239 #ifndef BOOST_FUNCTION_NO_DEPRECATED
240                                 , public Mixin
241 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
242   {
243     typedef typename detail::function::function_return_type<R>::type 
244       internal_result_type;
245
246   public:
247     BOOST_STATIC_CONSTANT(int, args = BOOST_FUNCTION_NUM_ARGS);
248     
249 #if BOOST_FUNCTION_NUM_ARGS == 1
250     typedef T0 argument_type;
251 #elif BOOST_FUNCTION_NUM_ARGS == 2
252     typedef T0 first_argument_type;
253     typedef T1 second_argument_type;
254 #endif
255
256     BOOST_STATIC_CONSTANT(int, arity = BOOST_FUNCTION_NUM_ARGS);
257     BOOST_FUNCTION_ARG_TYPES
258
259 #ifndef BOOST_NO_VOID_RETURNS
260     typedef R         result_type;
261 #else
262     typedef internal_result_type result_type;
263 #endif // BOOST_NO_VOID_RETURNS
264 #ifndef BOOST_FUNCTION_NO_DEPRECATED
265     typedef Policy    policy_type;
266     typedef Mixin     mixin_type;
267 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
268     typedef Allocator allocator_type;
269     typedef BOOST_FUNCTION_FUNCTION self_type;
270
271     BOOST_FUNCTION_FUNCTION() : function_base()
272 #ifndef BOOST_FUNCTION_NO_DEPRECATED
273                               , Mixin()
274 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
275                               , invoker(0) {}
276
277 #ifndef BOOST_FUNCTION_NO_DEPRECATED
278     explicit BOOST_FUNCTION_FUNCTION(const Mixin& m) : 
279       function_base(), 
280       Mixin(m), 
281       invoker(0) 
282     {
283     }
284 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
285
286     // MSVC chokes if the following two constructors are collapsed into
287     // one with a default parameter.
288     template<typename Functor>
289     BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) :
290       function_base(), 
291 #ifndef BOOST_FUNCTION_NO_DEPRECATED
292       Mixin(), 
293 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
294       invoker(0)
295     {
296       this->assign_to(f);
297     }
298
299 #ifndef BOOST_FUNCTION_NO_DEPRECATED
300     template<typename Functor>
301     BOOST_FUNCTION_FUNCTION(Functor f, const Mixin& m) :
302       function_base(), 
303       Mixin(m), 
304       invoker(0)
305     {
306       this->assign_to(f);
307     }
308 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
309
310     BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) :
311       function_base(),
312 #ifndef BOOST_FUNCTION_NO_DEPRECATED
313       Mixin(static_cast<const Mixin&>(f)), 
314 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
315       invoker(0)
316     {
317       this->assign_to_own(f);
318     }
319
320     ~BOOST_FUNCTION_FUNCTION() { clear(); }
321
322     result_type operator()(BOOST_FUNCTION_PARMS) const
323     {
324       assert(!this->empty());
325
326 #ifndef BOOST_FUNCTION_NO_DEPRECATED
327       policy_type policy;
328       policy.precall(this);
329 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
330
331       internal_result_type result = invoker(function_base::functor 
332                                             BOOST_FUNCTION_COMMA
333                                             BOOST_FUNCTION_ARGS);
334
335 #ifndef BOOST_FUNCTION_NO_DEPRECATED
336       policy.postcall(this);
337 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
338
339 #ifndef BOOST_NO_VOID_RETURNS
340       return static_cast<result_type>(result);
341 #else
342       return result;
343 #endif // BOOST_NO_VOID_RETURNS
344     }
345
346     // The distinction between when to use BOOST_FUNCTION_FUNCTION and
347     // when to use self_type is obnoxious. MSVC cannot handle self_type as
348     // the return type of these assignment operators, but Borland C++ cannot
349     // handle BOOST_FUNCTION_FUNCTION as the type of the temporary to 
350     // construct.
351     template<typename Functor>
352     BOOST_FUNCTION_FUNCTION& 
353     operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
354     {
355 #ifndef BOOST_FUNCTION_NO_DEPRECATED
356       self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
357 #else
358       self_type(f).swap(*this);
359 #endif // BOOST_FUNCTION_NO_DEPRECATED
360       return *this;
361     }
362
363 #ifndef BOOST_FUNCTION_NO_DEPRECATED
364     template<typename Functor>
365     BOOST_FUNCTION_DEPRECATED_PRE
366     void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
367     {
368       BOOST_FUNCTION_DEPRECATED_INNER
369       self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
370     }
371 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
372
373     // Assignment from another BOOST_FUNCTION_FUNCTION
374     BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f)
375     {
376       if (&f == this)
377         return *this;
378
379       self_type(f).swap(*this);
380       return *this;
381     }
382
383 #ifndef BOOST_FUNCTION_NO_DEPRECATED
384     // Assignment from another BOOST_FUNCTION_FUNCTION
385     BOOST_FUNCTION_DEPRECATED_PRE
386     void set(const BOOST_FUNCTION_FUNCTION& f)
387     {
388       BOOST_FUNCTION_DEPRECATED_INNER
389       if (&f == this)
390         return;
391
392       self_type(f).swap(*this);
393     }
394 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
395
396     void swap(BOOST_FUNCTION_FUNCTION& other)
397     {
398       if (&other == this)
399         return;
400
401       std::swap(function_base::manager, other.manager);
402       std::swap(function_base::functor, other.functor);
403       std::swap(invoker, other.invoker);
404 #ifndef BOOST_FUNCTION_NO_DEPRECATED
405       std::swap(static_cast<Mixin&>(*this), static_cast<Mixin&>(other));
406 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
407     }
408
409     // Clear out a target, if there is one
410     void clear()
411     {
412       if (function_base::manager) {
413         function_base::functor = 
414           function_base::manager(function_base::functor, 
415                                  detail::function::destroy_functor_tag);
416       }
417
418       function_base::manager = 0;
419       invoker = 0;
420     }
421
422 #if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG)
423     // Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
424     operator bool () const { return !this->empty(); }
425 #else
426   private:
427     struct dummy {
428       void nonnull() {};
429     };
430
431     typedef void (dummy::*safe_bool)();
432
433   public:
434     operator safe_bool () const 
435       { return (this->empty())? 0 : &dummy::nonnull; }
436
437     bool operator!() const
438       { return this->empty(); }
439 #endif
440
441   private:
442     void assign_to_own(const BOOST_FUNCTION_FUNCTION& f)
443     {
444       if (!f.empty()) {
445         invoker = f.invoker;
446         function_base::manager = f.manager;
447         function_base::functor = 
448           f.manager(f.functor, detail::function::clone_functor_tag);
449       }          
450     }
451
452     template<typename Functor>
453     void assign_to(Functor f)
454     {
455       typedef typename detail::function::get_function_tag<Functor>::type tag;
456       this->assign_to(f, tag());
457     }
458
459     template<typename FunctionPtr>
460     void assign_to(FunctionPtr f, detail::function::function_ptr_tag)
461     {
462       clear();
463         
464       if (f) {
465         typedef typename detail::function::BOOST_FUNCTION_GET_FUNCTION_INVOKER<
466                            FunctionPtr,
467                            R BOOST_FUNCTION_COMMA
468                            BOOST_FUNCTION_TEMPLATE_ARGS
469                          >::type
470           invoker_type;
471     
472         invoker = &invoker_type::invoke;
473         function_base::manager = 
474           &detail::function::functor_manager<FunctionPtr, Allocator>::manage;
475         function_base::functor = 
476           function_base::manager(detail::function::any_pointer(
477                             // should be a reinterpret cast, but some compilers
478                             // insist on giving cv-qualifiers to free functions
479                             (void (*)())(f)
480                           ),
481                           detail::function::clone_functor_tag);
482       }
483     }  
484
485 #if BOOST_FUNCTION_NUM_ARGS > 0
486     template<typename MemberPtr>
487     void assign_to(MemberPtr f, detail::function::member_ptr_tag)
488     {
489       this->assign_to(mem_fn(f));
490     }
491 #endif // BOOST_FUNCTION_NUM_ARGS > 0
492         
493     template<typename FunctionObj>
494     void assign_to(FunctionObj f, detail::function::function_obj_tag)
495     {
496       if (!detail::function::has_empty_target(addressof(f))) {
497         typedef 
498           typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
499                                        FunctionObj,
500                                        R BOOST_FUNCTION_COMMA
501                                        BOOST_FUNCTION_TEMPLATE_ARGS
502                                      >::type
503           invoker_type;
504     
505         invoker = &invoker_type::invoke;
506         function_base::manager = &detail::function::functor_manager<
507                                     FunctionObj, Allocator>::manage;
508 #ifndef BOOST_NO_STD_ALLOCATOR
509         typedef typename Allocator::template rebind<FunctionObj>::other 
510           allocator_type;
511         typedef typename allocator_type::pointer pointer_type;
512         allocator_type allocator;
513         pointer_type copy = allocator.allocate(1);
514         allocator.construct(copy, f);
515
516         // Get back to the original pointer type
517         FunctionObj* new_f = static_cast<FunctionObj*>(copy);
518 #else
519         FunctionObj* new_f = new FunctionObj(f);
520 #endif // BOOST_NO_STD_ALLOCATOR
521         function_base::functor = 
522           detail::function::any_pointer(static_cast<void*>(new_f));
523       }
524     }
525     
526     template<typename FunctionObj>
527     void assign_to(const reference_wrapper<FunctionObj>& f, 
528                    detail::function::function_obj_ref_tag)
529     {
530       if (!detail::function::has_empty_target(f.get_pointer())) {
531         typedef 
532           typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
533                                        FunctionObj,
534                                        R BOOST_FUNCTION_COMMA
535                                        BOOST_FUNCTION_TEMPLATE_ARGS
536                                      >::type
537           invoker_type;
538     
539         invoker = &invoker_type::invoke;
540         function_base::manager = &detail::function::trivial_manager;
541         function_base::functor = 
542           function_base::manager(
543             detail::function::any_pointer(
544               const_cast<FunctionObj*>(f.get_pointer())),
545             detail::function::clone_functor_tag);
546       }
547     }
548     
549     template<typename FunctionObj>
550     void assign_to(FunctionObj, detail::function::stateless_function_obj_tag)
551     {
552       typedef 
553           typename detail::function::
554                      BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER<
555                        FunctionObj,
556                        R BOOST_FUNCTION_COMMA
557                        BOOST_FUNCTION_TEMPLATE_ARGS
558                      >::type
559           invoker_type;
560       invoker = &invoker_type::invoke;
561       function_base::manager = &detail::function::trivial_manager;
562       function_base::functor = detail::function::any_pointer(this);
563     }
564
565     typedef internal_result_type (*invoker_type)(detail::function::any_pointer
566                                                  BOOST_FUNCTION_COMMA
567                                                  BOOST_FUNCTION_TEMPLATE_ARGS);
568     
569     invoker_type invoker;
570   };
571
572   template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
573 #ifndef BOOST_FUNCTION_NO_DEPRECATED
574            typename Policy, typename Mixin, 
575 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
576            typename Allocator>
577   inline void swap(BOOST_FUNCTION_FUNCTION<
578                      R BOOST_FUNCTION_COMMA
579                      BOOST_FUNCTION_TEMPLATE_ARGS ,
580 #ifndef BOOST_FUNCTION_NO_DEPRECATED
581                      Policy,
582                      Mixin,
583 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
584                      Allocator
585                    >& f1,
586                    BOOST_FUNCTION_FUNCTION<
587                      R BOOST_FUNCTION_COMMA 
588                      BOOST_FUNCTION_TEMPLATE_ARGS,
589 #ifndef BOOST_FUNCTION_NO_DEPRECATED
590                      Policy,
591                      Mixin,
592 #endif // ndef BOOST_FUNCTION_NO_DEPRECATED
593                      Allocator
594                    >& f2)
595   {
596     f1.swap(f2);
597   }
598 }
599
600 // Cleanup after ourselves...
601 #undef BOOST_FUNCTION_DEFAULT_ALLOCATOR
602 #undef BOOST_FUNCTION_COMMA
603 #undef BOOST_FUNCTION_FUNCTION
604 #undef BOOST_FUNCTION_FUNCTION_INVOKER
605 #undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
606 #undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
607 #undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
608 #undef BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER
609 #undef BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER
610 #undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
611 #undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
612 #undef BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER
613 #undef BOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER