• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2016 Lee Clagett
3 
4     Use modification and distribution are subject to the Boost Software
5     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6     http://www.boost.org/LICENSE_1_0.txt).
7 ==============================================================================*/
8 #include <boost/detail/lightweight_test.hpp>
9 #include <boost/fusion/tuple.hpp>
10 
11 #define FUSION_SEQUENCE boost::fusion::tuple
12 #include "conversion.hpp"
13 
14 // Bug in C++03 tuple? Cannot construct from a std::pair without including
15 // std::pair fusion adaption
16 #if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
17 # include <boost/fusion/adapted/std_pair.hpp>
18 #endif
19 
20 using namespace test_detail;
21 
test_tuple()22 void test_tuple()
23 {
24     BOOST_TEST((
25         run< can_copy< boost::fusion::tuple<int, int> > >(
26             std::pair<int, int>(1, 9)
27         )
28     ));
29     BOOST_TEST((
30         run< can_copy< boost::fusion::tuple<int, convertible> > >(
31             std::pair<int, int>(1, 9)
32         )
33     ));
34     BOOST_TEST((
35         run< can_copy< boost::fusion::tuple<convertible, int> > >(
36             std::pair<int, int>(1, 9)
37         )
38     ));
39     BOOST_TEST((
40         run< can_copy< boost::fusion::tuple<convertible, convertible> > >(
41             std::pair<int, int>(1, 9)
42         )
43     ));
44 }
45 
main()46 int main()
47 {
48     test<can_assign>(); // conversion construction not supported
49     test_tuple();
50     return boost::report_errors();
51 }
52