File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -57,3 +57,8 @@ local check14 = [ check-target-builds mixed_cxxstd/<cxxstd>14 : : <build>no ] ;
57
57
58
58
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>14 : : : <link>shared $(check14) : mixed_cxxstd_shared_14 ;
59
59
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>14 : : : <link>static $(check14) : mixed_cxxstd_static_14 ;
60
+
61
+ lib return_function : return_function.cpp : <link>shared:<define>RETURN_FUNCTION_DYN_LINK=1 ;
62
+
63
+ run test_return_function.cpp return_function : : : <link>shared : return_function_shared ;
64
+ run test_return_function.cpp return_function : : : <link>static : return_function_static ;
Original file line number Diff line number Diff line change
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(RETURN_FUNCTION_DYN_LINK)
9
+ # define EXPORT BOOST_SYMBOL_EXPORT
10
+ #else
11
+ # define EXPORT
12
+ #endif
13
+
14
+ int f ( int x, int y )
15
+ {
16
+ return x + y;
17
+ }
18
+
19
+ EXPORT boost::function<int (int , int )> get_fn_1 ()
20
+ {
21
+ return f;
22
+ }
23
+
24
+ EXPORT boost::function2<int , int , int > get_fn_2 ()
25
+ {
26
+ return f;
27
+ }
Original file line number Diff line number Diff line change
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/core/lightweight_test.hpp>
7
+
8
+ //
9
+
10
+ boost::function<int (int , int )> get_fn_1 ();
11
+ boost::function2<int , int , int > get_fn_2 ();
12
+
13
+ //
14
+
15
+ int main ()
16
+ {
17
+ BOOST_TEST_EQ ( get_fn_1 ()( 1 , 2 ), 3 );
18
+ BOOST_TEST_EQ ( get_fn_2 ()( 1 , 2 ), 3 );
19
+
20
+ return boost::report_errors ();
21
+ }
You can’t perform that action at this time.
0 commit comments