Imported Upstream version 1.64.0
[platform/upstream/boost.git] / libs / function / test / result_arg_types_test.cpp
1 // Boost.Function library
2
3 //  Copyright 2016 Peter Dimov
4
5 //  Use, modification and distribution is subject to
6 //  the Boost Software License, Version 1.0.
7 //  (See accompanying file LICENSE_1_0.txt or copy at
8 //  http://www.boost.org/LICENSE_1_0.txt)
9
10 #include <boost/function.hpp>
11 #include <boost/core/is_same.hpp>
12 #include <boost/core/lightweight_test_trait.hpp>
13
14 struct X
15 {
16 };
17
18 struct Y
19 {
20 };
21
22 struct Z
23 {
24 };
25
26 int main()
27 {
28     typedef boost::function<X(Y)> F1;
29
30     BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::result_type, X> ));
31     BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::argument_type, Y> ));
32
33     typedef boost::function<X(Y, Z)> F2;
34
35     BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::result_type, X> ));
36     BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::first_argument_type, Y> ));
37     BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::second_argument_type, Z> ));
38
39     return boost::report_errors();
40 }