mixed_cxxstd.cpp 745 B

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