From e5cf2988354d9d5b0c29ac8cd84057da0d8de56d Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 21 Nov 2006 22:49:05 +0000 Subject: [PATCH] variant and boost tuple adaptor docs [SVN r36140] --- doc/fusion.qbk | 2 ++ doc/sequences.qbk | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/doc/fusion.qbk b/doc/fusion.qbk index 72b8d50a..2dbbffe9 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -32,6 +32,8 @@ [def __boost_any__ [@http://boost.org/doc/html/any.html Boost.Any]] [def __new_iterator_concepts__ [@http://boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts]] [def __boost_array_library__ [@http://www.boost.org/doc/html/array.html Boost.Array Library]] +[def __boost_variant_library__ [@http://www.boost.org/doc/html/variant.html Boost.Variant Library]] +[def __boost_tuple_library__ [@http://www.boost.org/libs/tuple/doc/tuple_users_guide.html Boost.Tuple Library]] [def __boost_ref__ [@http://www.boost.org/doc/html/ref.html Boost.Ref]] [def __boost_ref_call__ [@http://www.boost.org/doc/html/ref.html `ref`]] [def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]] diff --git a/doc/sequences.qbk b/doc/sequences.qbk index 627ed680..8c81289c 100644 --- a/doc/sequences.qbk +++ b/doc/sequences.qbk @@ -1326,6 +1326,58 @@ __boost_array_library__ [endsect] +[section boost::tuple] +This module provides adapters for `boost::tuple`. Including the module +header makes `boost::tuple` a fully conforming __forward_sequence__. + +[heading Header] + + #include + +[heading Model of] + +* __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'; + +[heading See also] + +__boost_tuple_library__ + +[endsect] + +[section boost::variant] +This module provides adapters for `boost::variant`. Including the module +header makes `boost::variant` a fully conforming __forward_sequence__. +The variant acts as a sequence of the types that can be contained in the variant. +Accessing types not currently stored int the variant will lead to the variant +being populated with a default constructed value of that type. + +[heading Header] + + #include + +[heading Model of] + +* __forward_sequence__ + +[heading Example] + + boost::variant example_variant = 101; + std::cout << example_variant << '\n'; + *boost::fusion::find(example_variant) = "hello"; + std::cout << example_variant << '\n'; + +[heading See also] + +__boost_variant_library__ + +[endsect] + [endsect] [section Intrinsics]