From 06428298bbb5180979f8e658dc896702c1b7e92d Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sat, 21 Feb 2015 19:16:13 +0900 Subject: [PATCH] Add docs for std::tuple adaptation. --- doc/adapted.qbk | 33 +++++++++++++++++++++++++++++++-- doc/fusion.qbk | 1 + doc/html/index.html | 1 + 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 9fd6c24a..a370e373 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -89,6 +89,35 @@ __std_pair_doc__, __tr1_tuple_pair__ [endsect] +[section std::tuple] + +This module provides adapters for `std::tuple`. Including the module header +makes `std::tuple` a fully conforming __random_access_sequence__. + +[important To be fully conforming, compiler should support C++11 Variadic Templates.] + +[heading Header] + + #include + #include + +[heading Model of] + +* __random_access_sequence__ + +[heading Example] + + std::tuple p(123, "Hola!!!", 456.f); + std::cout << __at_c__<0>(p) << std::endl; + std::cout << __at_c__<1>(p) << std::endl; + std::cout << p << std::endl; + +[heading See also] + +__std_tuple_doc__ + +[endsect] + [section mpl sequence] This module provides adapters for __mpl__ sequences. Including the module @@ -168,8 +197,8 @@ header makes `boost::tuple` a fully conforming __forward_sequence__. [heading Example] boost::tuple example_tuple(101, "hello"); - std::cout << *boost::fusion::begin(example_tuple) << '\n'; - std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n'; + std::cout << *__begin__(example_tuple) << '\n'; + std::cout << *__next__(__begin__(example_tuple)) << '\n'; [heading See also] diff --git a/doc/fusion.qbk b/doc/fusion.qbk index 0ca7919c..d47fc9cd 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -55,6 +55,7 @@ [def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory/doc/html/index.html Boost.Functional/Factory]] [def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.Functional/Hash]] [def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]] +[def __std_tuple_doc__ [@http://en.cppreference.com/w/cpp/utility/tuple `std::tuple`]] [def __std_plus_doc__ [@http://www.sgi.com/tech/stl/plus.html `std::plus`]] [def __std_minus_doc__ [@http://www.sgi.com/tech/stl/minus.html `std::minus`]] diff --git a/doc/html/index.html b/doc/html/index.html index 03b417ee..0fd880b6 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -167,6 +167,7 @@
Array
std::pair
+
std::tuple
mpl sequence
boost::array
boost::tuple