final_base.cpp 736 B

1234567891011121314151617181920212223242526
  1. /*=============================================================================
  2. Copyright (c) 2017 Paul Fultz II
  3. final_base.cpp
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #include <boost/hof/flip.hpp>
  8. #include "test.hpp"
  9. #if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
  10. #define FINAL
  11. #else
  12. #define FINAL final
  13. #endif
  14. struct f FINAL {
  15. int operator()(int i, void *) const {
  16. return i;
  17. }
  18. };
  19. BOOST_HOF_TEST_CASE()
  20. {
  21. BOOST_HOF_TEST_CHECK(boost::hof::flip(f())(nullptr, 2) == 2);
  22. }