diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-08 03:09:47 +0000 |
---|---|---|
committer | <> | 2015-05-05 14:37:32 +0000 |
commit | f2541bb90af059680aa7036f315f052175999355 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /libs/fusion/test/sequence/std_tuple.cpp | |
parent | ed232fdd34968697a68783b3195b1da4226915b5 (diff) | |
download | boost-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'libs/fusion/test/sequence/std_tuple.cpp')
-rw-r--r-- | libs/fusion/test/sequence/std_tuple.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libs/fusion/test/sequence/std_tuple.cpp b/libs/fusion/test/sequence/std_tuple.cpp new file mode 100644 index 000000000..2495fa550 --- /dev/null +++ b/libs/fusion/test/sequence/std_tuple.cpp @@ -0,0 +1,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 |