boost_no_cxx_hdr_functional.ipp 895 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // (C) Copyright John Maddock 2012
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for more information.
  6. // MACRO: BOOST_NO_CXX11_HDR_FUNCTIONAL
  7. // TITLE: C++11 <functional> unavailable
  8. // DESCRIPTION: The compiler does not support the C++11 features added to <functional>
  9. #include <functional>
  10. void f(int, float){}
  11. namespace boost_no_cxx11_hdr_functional {
  12. int test()
  13. {
  14. int i = 0;
  15. std::ref(i);
  16. std::cref(i);
  17. std::bit_and<int> b1;
  18. std::bit_or<int> b2;
  19. std::bit_xor<int> b3;
  20. std::hash<short> hs;
  21. (void)b1;
  22. (void)b2;
  23. (void)b3;
  24. (void)hs;
  25. std::bind(f, std::placeholders::_1, 0.0f);
  26. std::function<void(int, float)> fun(f);
  27. return 0;
  28. }
  29. }