• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
10 
11 #define BOOST_TEST_MODULE TestResultOf
12 #include <boost/test/unit_test.hpp>
13 
14 #include <boost/compute/function.hpp>
15 #include <boost/compute/functional/operator.hpp>
16 #include <boost/compute/type_traits/result_of.hpp>
17 
BOOST_AUTO_TEST_CASE(result_of_function)18 BOOST_AUTO_TEST_CASE(result_of_function)
19 {
20     using boost::compute::function;
21     using boost::compute::result_of;
22 
23     BOOST_STATIC_ASSERT((
24         boost::is_same<result_of<function<int()>()>::type, int>::value
25     ));
26 }
27 
BOOST_AUTO_TEST_CASE(result_of_operators)28 BOOST_AUTO_TEST_CASE(result_of_operators)
29 {
30     using boost::compute::plus;
31     using boost::compute::minus;
32     using boost::compute::result_of;
33 
34     BOOST_STATIC_ASSERT((
35         boost::is_same<result_of<plus<int>(int, int)>::type, int>::value
36     ));
37     BOOST_STATIC_ASSERT((
38         boost::is_same<result_of<minus<int>(int, int)>::type, int>::value
39     ));
40 }
41