• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 
12 static constexpr boost::hof::result_adaptor<int, unary_class> unary_int = {};
13 
BOOST_HOF_TEST_CASE()14 BOOST_HOF_TEST_CASE()
15 {
16     STATIC_ASSERT_SAME(decltype(unary_int(false)), int);
17     BOOST_HOF_TEST_CHECK(unary_int(false) == 0);
18     BOOST_HOF_STATIC_TEST_CHECK(unary_int(false) == 0);
19 }
20 
21 static constexpr boost::hof::result_adaptor<void, unary_class> unary_void = {};
22 
BOOST_HOF_TEST_CASE()23 BOOST_HOF_TEST_CASE()
24 {
25     STATIC_ASSERT_SAME(decltype(unary_void(false)), void);
26 }
27