summaryrefslogtreecommitdiff
path: root/libs/fusion/test/sequence/std_tuple.cpp
blob: 2495fa550adb1263dac6786e72423e81b03ed458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*=============================================================================
    Copyright (c) 2014 Kohei Takahashi

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/

#include <boost/config.hpp>

// adapted/std_tuple.hpp only supports implementations using variadic templates
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && \
    !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)

#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/fusion/sequence/convert.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <tuple>
#include <string>

int
main()
{
    using namespace boost::fusion;
    using namespace boost;

    {
        // conversion vector to std tuple
        std::tuple<int, std::string> t = convert<std_tuple_tag>(make_vector(123, "Hola!!!"));
        BOOST_TEST(std::get<0>(t) == 123);
        BOOST_TEST(std::get<1>(t) == "Hola!!!");
    }

    return boost::report_errors();
}

#else

int
main()
{
    return 0;
}

#endif