Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63219 - trunk/libs/fusion/doc
From: steven_at_[hidden]
Date: 2010-06-22 00:17:15


Author: steven_watanabe
Date: 2010-06-22 00:17:12 EDT (Tue, 22 Jun 2010)
New Revision: 63219
URL: http://svn.boost.org/trac/boost/changeset/63219

Log:
Document repetitive_view. Fixes #1864.
Text files modified:
   trunk/libs/fusion/doc/view.qbk | 66 ++++++++++++++++++++++++++++++++++++++++
   1 files changed, 66 insertions(+), 0 deletions(-)

Modified: trunk/libs/fusion/doc/view.qbk
==============================================================================
--- trunk/libs/fusion/doc/view.qbk (original)
+++ trunk/libs/fusion/doc/view.qbk 2010-06-22 00:17:12 EDT (Tue, 22 Jun 2010)
@@ -548,4 +548,70 @@
 
 [endsect]
 
+
+[section repetitive_view]
+
+[heading Description]
+
+`repetitive_view` presents a view which iterates over a given
+__sequence__ repeatedly. Because a `repetitive_view`
+has infinite length, it can only be used when some external
+condition determines the end. Thus, initializing a fixed
+length sequence with a `repetitive_view` is okay, but
+printing a `repetitive_view` to `std::cout` is not.
+
+[heading Header]
+
+ #include <boost/fusion/view/repetitive_view.hpp>
+ #include <boost/fusion/include/repetitive_view.hpp>
+
+[heading Synopsis]
+
+ template <typename Sequence>
+ struct repetitive_view;
+
+[heading Template parameters]
+
+[table
+ [[Parameter] [Description] [Default]]
+ [[`Sequence`] [An arbitrary Fusion __forward_sequence__]
+ []]
+]
+
+[variablelist Notation
+ [[`RV`] [A `repetitive_view` type]]
+ [[`s`] [An instance of `Sequences`]]
+ [[`rv`, `rv1`, `rv2`] [Instances of `RV`]]
+]
+
+[heading Expression Semantics]
+
+[table
+ [[Expression] [Return Type] [Semantics]]
+ [[`RV(s)`] [] [Creates an `repetitive_view` given a sequence and a list of indicies.]]
+ [[`RV(rv1)`] [] [Copy constructs an `repetitive_view` from another `repetitive_view`, `rv1`.]]
+ [[`rv1 = rv2`] [] [Assigns to a `repetitive_view`, `rv1`, from another `repetitive_view`, `rv2`.]]
+ [[`__begin__(rv)`] [__forward_iterator__] []]
+ [[`__end__(rv)`] [__forward_iterator__] [Creates an unreachable iterator (since the sequnce is infinite)]]
+]
+
+[heading Result Type Expressions]
+
+[table
+ [[Expression]]
+ [[`__result_of_begin__<RV>::type`]]
+ [[`__result_of_end__<RV>::type`]]
+]
+
+[heading Example]
+ typedef __vector__<int, char, double> vec1;
+ typedef __vector__<int, char, double, int, char> vec2;
+
+ vec1 v1(1, 'c', 2.0);
+ vec2 v2(repetitive_view<vec1>(v1));
+
+ std::cout << v2 << std::endl; // 1, 'c', 2.0, 1, 'c'
+
+[endsect]
+
 [endsect]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk