• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2014 Kohei Takahashi
3 
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 
8 #include <boost/config.hpp>
9 
10 // adapted/std_tuple.hpp only supports implementations using variadic templates
11 #if defined(BOOST_NO_CXX11_HDR_TUPLE) || \
12     defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
13 #   error "does not meet requirements"
14 #endif
15 
16 #include <boost/detail/lightweight_test.hpp>
17 #include <boost/fusion/adapted/std_tuple.hpp>
18 #include <boost/fusion/sequence/convert.hpp>
19 #include <boost/fusion/container/vector/vector.hpp>
20 #include <boost/fusion/container/generation/make_vector.hpp>
21 #include <tuple>
22 #include <string>
23 
main()24 int main()
25 {
26     using namespace boost::fusion;
27     using namespace boost;
28 
29     {
30         // conversion vector to std tuple
31         std::tuple<int, std::string> t = convert<std_tuple_tag>(make_vector(123, std::string("Hola!!!")));
32         BOOST_TEST(std::get<0>(t) == 123);
33         BOOST_TEST(std::get<1>(t) == "Hola!!!");
34     }
35 
36     return boost::report_errors();
37 }
38