result.cpp 888 B

1234567891011121314151617181920212223242526
  1. /*=============================================================================
  2. Copyright (c) 2017 Paul Fultz II
  3. result.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/result.hpp>
  8. #include <boost/hof/static.hpp>
  9. #include "test.hpp"
  10. static constexpr boost::hof::result_adaptor<int, unary_class> unary_int = {};
  11. BOOST_HOF_TEST_CASE()
  12. {
  13. STATIC_ASSERT_SAME(decltype(unary_int(false)), int);
  14. BOOST_HOF_TEST_CHECK(unary_int(false) == 0);
  15. BOOST_HOF_STATIC_TEST_CHECK(unary_int(false) == 0);
  16. }
  17. static constexpr boost::hof::result_adaptor<void, unary_class> unary_void = {};
  18. BOOST_HOF_TEST_CASE()
  19. {
  20. STATIC_ASSERT_SAME(decltype(unary_void(false)), void);
  21. }