return_function.cpp 439 B

123456789101112131415161718192021222324252627
  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(RETURN_FUNCTION_DYN_LINK)
  6. # define EXPORT BOOST_SYMBOL_EXPORT
  7. #else
  8. # define EXPORT
  9. #endif
  10. int f( int x, int y )
  11. {
  12. return x + y;
  13. }
  14. EXPORT boost::function<int(int, int)> get_fn_1()
  15. {
  16. return f;
  17. }
  18. EXPORT boost::function2<int, int, int> get_fn_2()
  19. {
  20. return f;
  21. }