1
2 // Copyright 2018 Peter Dimov.
3 // Distributed under the Boost Software License, Version 1.0.
4
5 #include <boost/function.hpp>
6 #include <boost/config.hpp>
7
8 #if defined(MIXED_CXXSTD_DYN_LINK)
9 # define EXPORT BOOST_SYMBOL_EXPORT
10 #else
11 # define EXPORT
12 #endif
13
call_fn_1(boost::function<void ()> const & fn)14 EXPORT void call_fn_1( boost::function<void()> const & fn )
15 {
16 fn();
17 }
18
call_fn_2(boost::function<void (int)> const & fn)19 EXPORT void call_fn_2( boost::function<void(int)> const & fn )
20 {
21 fn( 1 );
22 }
23
call_fn_3(boost::function<void (int,int)> const & fn)24 EXPORT void call_fn_3( boost::function<void(int, int)> const & fn )
25 {
26 fn( 1, 2 );
27 }
28
call_fn_4(boost::function0<void> const & fn)29 EXPORT void call_fn_4( boost::function0<void> const & fn )
30 {
31 fn();
32 }
33
call_fn_5(boost::function1<void,int> const & fn)34 EXPORT void call_fn_5( boost::function1<void, int> const & fn )
35 {
36 fn( 1 );
37 }
38
call_fn_6(boost::function2<void,int,int> const & fn)39 EXPORT void call_fn_6( boost::function2<void, int, int> const & fn )
40 {
41 fn( 1, 2 );
42 }
43