Quickbook: Copy trunk libs into quickbook-dev branch.

[SVN r75213]
This commit is contained in:
Daniel James
2011-11-01 13:04:29 +00:00
188 changed files with 1475 additions and 888 deletions

View File

@ -1,5 +1,5 @@
#============================================================================== #==============================================================================
# Copyright (c) 2003-2007 Joel de Guzman # Copyright (c) 2003-2011 Joel de Guzman
# #
# Use, modification and distribution is subject to the Boost Software # Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Copyright (C) 2010 Christopher Schmidt Copyright (C) 2010 Christopher Schmidt
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Copyright (C) 2010 Christopher Schmidt Copyright (C) 2010 Christopher Schmidt
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
@ -10,18 +11,20 @@
[heading Lazy Evaluation] [heading Lazy Evaluation]
Unlike __mpl__, Fusion algorithms are lazy and non sequence-type Unlike __mpl__, Fusion algorithms are lazy[footnote Except for some
preserving. What does that mean? It means that when you operate on a special cases such as __for_each__ and __copy__ which are inherently
sequence through a Fusion algorithm that returns a sequence, the sequence imperative algorithms.] and non sequence-type preserving [footnote What
returned may not be of the same class as the original. This is by design. does that mean? It means that when you operate on a sequence through a
Runtime efficiency is given a high priority. Like __mpl__, and unlike Fusion algorithm that returns a sequence, the sequence returned may not
__stl__, fusion algorithms are functional in nature such that algorithms be of the same class as the original]. This is by design. Runtime
efficiency is given a high priority. Like __mpl__, and unlike __stl__,
fusion algorithms are mostly functional in nature such that algorithms
are non mutating (no side effects). However, due to the high cost of are non mutating (no side effects). However, due to the high cost of
returning full sequences such as vectors and lists, /Views/ are returned returning full sequences such as vectors and lists, /Views/ are returned
from Fusion algorithms instead. For example, the __transform__ algorithm from Fusion algorithms instead. For example, the __transform__ algorithm
does not actually return a transformed version of the original sequence. does not actually return a transformed version of the original sequence.
__transform__ returns a __transform_view__. This view holds a reference to __transform__ returns a __transform_view__. This view holds a reference
the original sequence plus the transform function. Iteration over the to the original sequence plus the transform function. Iteration over the
__transform_view__ will apply the transform function over the sequence __transform_view__ will apply the transform function over the sequence
elements on demand. This /lazy/ evaluation scheme allows us to chain as elements on demand. This /lazy/ evaluation scheme allows us to chain as
many algorithms as we want without incurring a high runtime penalty. many algorithms as we want without incurring a high runtime penalty.
@ -37,6 +40,7 @@ the original sequence `s` and the value `x`. Functions that were once
sequence specific and need to be implemented N times over N different sequence specific and need to be implemented N times over N different
sequences are now implemented only once. That is to say that Fusion sequences are now implemented only once. That is to say that Fusion
sequences are cheaply extensible. sequences are cheaply extensible.
To regain the original sequence, __conversion__ functions are provided. You To regain the original sequence, __conversion__ functions are provided. You
may use one of the __conversion__ functions to convert back to the original may use one of the __conversion__ functions to convert back to the original
sequence type. sequence type.
@ -46,6 +50,61 @@ sequence type.
#include <boost/fusion/algorithm.hpp> #include <boost/fusion/algorithm.hpp>
#include <boost/fusion/include/algorithm.hpp> #include <boost/fusion/include/algorithm.hpp>
[section Auxiliary]
The auxiliary algorithms provide the utility algorithms for sequences.
[heading Header]
#include <boost/fusion/algorithm/auxiliary.hpp>
#include <boost/fusion/include/auxiliary.hpp>
[section Functions]
[section copy]
[heading Description]
Copy a sequence `src` to a sequence `dest`.
It is also used to convert sequence into other.
[heading Synopsis]
template <typename Seq1, typename Seq2>
void copy(Seq1 const& src, Seq2& dest);
[table Parameters
[[Parameter][Requirement][Description]]
[[`src`][A model of __forward_sequence__, all elements contained in the `src` sequence should be convertible into the element contained in the `dest` sequence.][Operation's argument]]
[[`dest`][A model of __forward_sequence__, `e2 = e1` is valid expression for each pair of elements `e1` of `src` and `e2` of `dest`.][Operation's argument]]
]
[heading Expression Semantics]
__copy__(src, dest);
[*Return type]: `void`
[*Semantics]: `e2 = e1` for each element `e1` in `src` and `e2` in `dest`.
[heading Complexity]
Linear, exactly `__result_of_size__<Sequence>::value`.
[heading Header]
#include <boost/fusion/algorithm/auxiliary/copy.hpp>
#include <boost/fusion/include/copy.hpp>
[heading Example]
__vector__<int,int> vec(1,2);
__list__<int,int> ls;
__copy__(vec, ls);
assert(ls == __make_list__(1,2));
[endsect]
[endsect]
[endsect]
[section Iteration] [section Iteration]
The iteration algorithms provide the fundamental algorithms for traversing The iteration algorithms provide the fundamental algorithms for traversing

View File

@ -1,5 +1,7 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Copyright (C) 2006 Tobias Schwinger
Copyright (C) 2010 Christopher Schmidt Copyright (C) 2010 Christopher Schmidt
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
@ -38,5 +40,10 @@ This section summarizes significant changes to the Fusion library.
* October 7, 2010: Added __adapt_adt__, __adapt_tpl_adt__, * October 7, 2010: Added __adapt_adt__, __adapt_tpl_adt__,
__adapt_assoc_adt__ and __adapt_assoc_tpl_adt__ (Joel de Guzman, __adapt_assoc_adt__ and __adapt_assoc_tpl_adt__ (Joel de Guzman,
Hartmut Kaiser and Christopher Schmidt) Hartmut Kaiser and Christopher Schmidt)
* August 29, 2011: Added support for segmented sequences and iterators (Eric Niebler)
* September 16, 2011: Added preprocessed files (using wave) to speed up
compilation (Joel de Guzman)
* October 8, 2011: Added adaptor for std::tuple (Joel de Guzman)
* October 10, 2011: Made map random access (Brandon Kohn)
[endsect] [endsect]

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -419,7 +420,7 @@ including any Fusion header to change the default. Example:
[heading Model of] [heading Model of]
* __associative_sequence__ * __associative_sequence__
* __forward_sequence__ * __random_access_sequence__
[variablelist Notation [variablelist Notation
[[`M`] [A `map` type]] [[`M`] [A `map` type]]
@ -431,7 +432,7 @@ including any Fusion header to change the default. Example:
[heading Expression Semantics] [heading Expression Semantics]
Semantics of an expression is defined only where it differs from, or is not Semantics of an expression is defined only where it differs from, or is not
defined in __random_access_sequence__ and __associative_sequence__. defined in __forward_sequence__ and __associative_sequence__.
[table [table
[[Expression] [Semantics]] [[Expression] [Semantics]]

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -390,7 +391,7 @@ for a variety of types.
[heading Description] [heading Description]
The __sequence_facade__ template provides an intrusive mechanism for The __sequence_facade__ template provides an intrusive mechanism for
producing a conforming Fusion iterator. producing a conforming Fusion sequence.
[heading Synopsis] [heading Synopsis]
template<typename Derived, typename TravesalTag, typename IsView = mpl::false_> template<typename Derived, typename TravesalTag, typename IsView = mpl::false_>
@ -415,6 +416,8 @@ The user must the implement the key expressions required by their sequence type.
[[`sequence::template end<Seq>::call(seq)`][An iterator to the end of sequence `seq`]] [[`sequence::template end<Seq>::call(seq)`][An iterator to the end of sequence `seq`]]
[[`sequence::template size<Seq>::type`][The size of a sequence of type `Seq` as an __mpl_integral_constant__]] [[`sequence::template size<Seq>::type`][The size of a sequence of type `Seq` as an __mpl_integral_constant__]]
[[`sequence::template size<Seq>::call(seq)`][The size of sequence `seq`]] [[`sequence::template size<Seq>::call(seq)`][The size of sequence `seq`]]
[[`sequence::template empty<Seq>::type`][Returns `mpl::true_` if `Seq` has zero elements, `mpl::false_` otherwise.]]
[[`sequence::template empty<Seq>::call`][Returns a type convertible to `bool` that evaluates to true if the sequence is empty, else, evaluates to false. ]]
[[`sequence::template at<Seq, N>::type`][The type of element `N` in a sequence of type `Seq`]] [[`sequence::template at<Seq, N>::type`][The type of element `N` in a sequence of type `Seq`]]
[[`sequence::template at<Seq, N>::call(seq)`][Element `N` in sequence `seq`]] [[`sequence::template at<Seq, N>::call(seq)`][Element `N` in sequence `seq`]]
[[`sequence::template value_at<Sequence, N>::type`][The type of the `N`th element in a sequence of type `Seq`]] [[`sequence::template value_at<Sequence, N>::type`][The type of the `N`th element in a sequence of type `Seq`]]
@ -465,8 +468,8 @@ The user must the implement the key expressions required by their iterator type.
[[`iterator::template advance<It, N>::call(it)`][An iterator advanced `N` elements from `it`][Implemented in terms of `next` and `prior`]] [[`iterator::template advance<It, N>::call(it)`][An iterator advanced `N` elements from `it`][Implemented in terms of `next` and `prior`]]
[[`iterator::template distance<It1, It2>::type`][The distance between iterators of type `It1` and `It2` as an __mpl_integral_constant__][None]] [[`iterator::template distance<It1, It2>::type`][The distance between iterators of type `It1` and `It2` as an __mpl_integral_constant__][None]]
[[`iterator::template distance<It1, It2>::call(it1, it2)`][The distance between iterator `it1` and `it2`][None]] [[`iterator::template distance<It1, It2>::call(it1, it2)`][The distance between iterator `it1` and `it2`][None]]
[[`iterator::template equal_to<It1, It2>::type`][The distance between iterators of type `It1` and `It2`][`boost::same_type<It1, It2>::type`]] [[`iterator::template equal_to<It1, It2>::type`][Returns `mpl::true_` if `It1` is equal to `It2`, `mpl::false_` otherwise.][`boost::same_type<It1, It2>::type`]]
[[`iterator::template equal_to<It1, It2>::call(it1, it2)`][The distance between iterators `it1` and `it2`][`boost::same_type<It1, It2>::type()`]] [[`iterator::template equal_to<It1, It2>::call(it1, it2)`][Returns a type convertible to `bool` that evaluates to `true` if `It1` is equal to `It2`, `false` otherwise.][`boost::same_type<It1, It2>::type()`]]
[[`iterator::template key_of<It>::type`][The key type associated with the element from `It`][None]] [[`iterator::template key_of<It>::type`][The key type associated with the element from `It`][None]]
[[`iterator::template value_of_data<It>::type`][The type of the data property associated with the element from `It`][None]] [[`iterator::template value_of_data<It>::type`][The type of the data property associated with the element from `It`][None]]
[[`iterator::template deref_data<It>::type`][The type that will be returned by dereferencing the data property of the element from `It`][None]] [[`iterator::template deref_data<It>::type`][The type that will be returned by dereferencing the data property of the element from `It`][None]]

View File

@ -1,5 +1,5 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2006 Tobias Schwinger
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Copyright (C) 2010 Christopher Schmidt Copyright (C) 2010 Christopher Schmidt
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
@ -8,9 +9,9 @@
===============================================================================/] ===============================================================================/]
[library Fusion [library Fusion
[quickbook 1.3] [quickbook 1.3]
[version 2.0] [version 2.2]
[authors [de Guzman, Joel], [Marsden, Dan], [Schwinger, Tobias]] [authors [de Guzman, Joel], [Marsden, Dan], [Schwinger, Tobias]]
[copyright 2001 2002 2003 2004 2005 2006 2007 Joel de Guzman, Dan Marsden, Tobias Schwinger] [copyright 2001 2002 2003 2004 2005 2006 2011 Joel de Guzman, Dan Marsden, Tobias Schwinger]
[purpose Statically Typed Heterogeneous Data Structures and Algorithms] [purpose Statically Typed Heterogeneous Data Structures and Algorithms]
[license [license
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
@ -215,6 +216,7 @@
[def __algorithm__ [link fusion.algorithm Algorithm]] [def __algorithm__ [link fusion.algorithm Algorithm]]
[def __algorithms__ [link fusion.algorithm Algorithms]] [def __algorithms__ [link fusion.algorithm Algorithms]]
[def __copy__ [link fusion.algorithm.auxiliary.functions.copy `copy`]]
[def __fold__ [link fusion.algorithm.iteration.functions.fold `fold`]] [def __fold__ [link fusion.algorithm.iteration.functions.fold `fold`]]
[def __result_of_fold__ [link fusion.algorithm.iteration.metafunctions.fold `result_of::fold`]] [def __result_of_fold__ [link fusion.algorithm.iteration.metafunctions.fold `result_of::fold`]]
[def __reverse_fold__ [link fusion.algorithm.iteration.functions.reverse_fold `reverse_fold`]] [def __reverse_fold__ [link fusion.algorithm.iteration.functions.reverse_fold `reverse_fold`]]

View File

@ -1,270 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
<title>Chapter&#160;1.&#160;Fusion 2.0</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> Distributed under the Boost Software License, Version 1.0.
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> (See accompanying file LICENSE_1_0.txt or copy at
<link rel="home" href="index.html" title="Chapter&#160;1.&#160;Fusion 2.0"> http://www.boost.org/LICENSE_1_0.txt) -->
<link rel="next" href="fusion/preface.html" title="Preface"> <title>Redirect to generated documentation</title>
</head> <meta http-equiv="refresh" content="0; URL=http://boost-sandbox.sourceforge.net/libs/fusion/doc/html/">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> </head>
<table cellpadding="2" width="100%"><tr> <body>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> Automatic redirection failed, please go to
<td align="center"><a href="../../../../index.html">Home</a></td> <a href="http://boost-sandbox.sourceforge.net/libs/fusion/doc/html/">http://boost-sandbox.sourceforge.net/libs/fusion/doc/html/</a>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> </body>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav"><a accesskey="n" href="fusion/preface.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="fusion"></a>Chapter&#160;1.&#160;Fusion 2.0</h2></div>
<div><div class="author"><h3 class="author">
<span class="firstname">Joel</span> <span class="surname">de Guzman</span>
</h3></div></div>
<div><div class="author"><h3 class="author">
<span class="firstname">Dan</span> <span class="surname">Marsden</span>
</h3></div></div>
<div><div class="author"><h3 class="author">
<span class="firstname">Tobias</span> <span class="surname">Schwinger</span>
</h3></div></div>
<div><p class="copyright">Copyright &#169; 2001-2007 Joel de Guzman, Dan Marsden, Tobias
Schwinger</p></div>
<div><div class="legalnotice">
<a name="id823866"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="section"><a href="fusion/preface.html">Preface</a></span></dt>
<dt><span class="section"><a href="fusion/introduction.html">Introduction</a></span></dt>
<dt><span class="section"><a href="fusion/quick_start.html">Quick Start</a></span></dt>
<dt><span class="section"><a href="fusion/organization.html">Organization</a></span></dt>
<dt><span class="section"><a href="fusion/support.html">Support</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/support/is_sequence.html">is_sequence</a></span></dt>
<dt><span class="section"><a href="fusion/support/is_view.html">is_view</a></span></dt>
<dt><span class="section"><a href="fusion/support/tag_of.html">tag_of</a></span></dt>
<dt><span class="section"><a href="fusion/support/category_of.html">category_of</a></span></dt>
<dt><span class="section"><a href="fusion/support/deduce.html">deduce</a></span></dt>
<dt><span class="section"><a href="fusion/support/deduce_sequence.html">deduce_sequence</a></span></dt>
<dt><span class="section"><a href="fusion/support/pair.html">pair</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/iterator.html">Iterator</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/iterator/concepts.html">Concepts</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/iterator/concepts/forward_iterator.html">Forward
Iterator</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/concepts/bidirectional_iterator.html">Bidirectional
Iterator</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/concepts/random_access_iterator.html">Random
Access Iterator</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/concepts/associative_iterator.html">Associative
Iterator</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/iterator/functions.html">Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/iterator/functions/deref.html">deref</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/functions/next.html">next</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/functions/prior.html">prior</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/functions/distance.html">distance</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/functions/advance.html">advance</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/functions/advance_c.html">advance_c</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/functions/deref_data.html">deref_data</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/iterator/operator.html">Operator</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/iterator/operator/operator_unary_star.html"> Operator
*</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/operator/operator_equality.html"> Operator
==</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/operator/operator_inequality.html"> Operator
!=</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/iterator/metafunctions.html">Metafunctions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/iterator/metafunctions/value_of.html">value_of</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/deref.html">deref</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/next.html">next</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/prior.html">prior</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/equal_to.html">equal_to</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/distance.html">distance</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/advance.html">advance</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/advance_c.html">advance_c</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/key_of.html">key_of</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/value_of_data.html">value_of_data</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/metafunctions/deref_data.html">deref_data</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="fusion/sequence.html">Sequence</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/sequence/concepts.html">Concepts</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/sequence/concepts/forward_sequence.html">Forward
Sequence</a></span></dt>
<dt><span class="section"><a href="fusion/sequence/concepts/bidirectional_sequence.html">Bidirectional
Sequence</a></span></dt>
<dt><span class="section"><a href="fusion/sequence/concepts/random_access_sequence.html">Random
Access Sequence</a></span></dt>
<dt><span class="section"><a href="fusion/sequence/concepts/associative_sequence.html">Associative
Sequence</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/sequence/intrinsic.html">Intrinsic</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/sequence/intrinsic/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/sequence/intrinsic/metafunctions.html">Metafunctions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/sequence/operator.html">Operator</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/sequence/operator/i_o.html">I/O</a></span></dt>
<dt><span class="section"><a href="fusion/sequence/operator/comparison.html">Comparison</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="fusion/container.html">Container</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/container/vector.html">vector</a></span></dt>
<dt><span class="section"><a href="fusion/container/cons.html">cons</a></span></dt>
<dt><span class="section"><a href="fusion/container/list.html">list</a></span></dt>
<dt><span class="section"><a href="fusion/container/set.html">set</a></span></dt>
<dt><span class="section"><a href="fusion/container/map.html">map</a></span></dt>
<dt><span class="section"><a href="fusion/container/generation.html">Generation</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/container/generation/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/container/generation/metafunctions.html">MetaFunctions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/container/conversion.html">Conversion</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/container/conversion/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/container/conversion/metafunctions.html">Metafunctions</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="fusion/view.html">View</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/view/single_view.html">single_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/filter_view.html">filter_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/iterator_range.html">iterator_range</a></span></dt>
<dt><span class="section"><a href="fusion/view/joint_view.html">joint_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/zip_view.html">zip_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/transform_view.html">transform_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/reverse_view.html">reverse_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/nview.html">nview</a></span></dt>
<dt><span class="section"><a href="fusion/view/repetitive_view.html">repetitive_view</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/adapted.html">Adapted</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/adapted/array.html"> Array</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/std__pair.html">std::pair</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/mpl_sequence.html">mpl sequence</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/boost__array.html">boost::array</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/boost__tuple.html">boost::tuple</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_struct.html"> BOOST_FUSION_ADAPT_STRUCT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_tpl_struct.html"> BOOST_FUSION_ADAPT_TPL_STRUCT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_struct_named.html"> BOOST_FUSION_ADAPT_STRUCT_NAMED</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_assoc.html"> BOOST_FUSION_ADAPT_ASSOC_STRUCT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_assoc_tpl_struct.html"> BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_assoc_struct_named.html"> BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_adt.html"> BOOST_FUSION_ADAPT_ADT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_tpl_adt.html"> BOOST_FUSION_ADAPT_TPL_ADT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_assoc_adt.html"> BOOST_FUSION_ADAPT_ASSOC_ADT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/adapt_assoc_tpl_adt.html"> BOOST_FUSION_ADAPT_ASSOC_TPL_ADT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/define_struct.html"> BOOST_FUSION_DEFINE_STRUCT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/define_tpl_struct.html"> BOOST_FUSION_DEFINE_TPL_STRUCT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/define_assoc_struct.html"> BOOST_FUSION_DEFINE_ASSOC_STRUCT</a></span></dt>
<dt><span class="section"><a href="fusion/adapted/define_assoc_tpl_struct.html"> BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/algorithm.html">Algorithm</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/algorithm/iteration.html">Iteration</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/algorithm/iteration/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/algorithm/iteration/metafunctions.html">Metafunctions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/algorithm/query.html">Query</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/algorithm/query/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/algorithm/query/metafunctions.html">Metafunctions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/algorithm/transformation.html">Transformation</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/algorithm/transformation/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/algorithm/transformation/metafunctions.html">Metafunctions</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="fusion/tuple.html">Tuple</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/tuple/class_template_tuple.html">Class template tuple</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/tuple/class_template_tuple/construction.html">Construction</a></span></dt>
<dt><span class="section"><a href="fusion/tuple/class_template_tuple/tuple_creation_functions.html">Tuple
creation functions</a></span></dt>
<dt><span class="section"><a href="fusion/tuple/class_template_tuple/tuple_helper_classes.html">Tuple
helper classes</a></span></dt>
<dt><span class="section"><a href="fusion/tuple/class_template_tuple/element_access.html">Element
access</a></span></dt>
<dt><span class="section"><a href="fusion/tuple/class_template_tuple/relational_operators.html">Relational
operators</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/tuple/pairs.html">Pairs</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/extension.html">Extension</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/extension/ext_full.html"> The Full Extension Mechanism</a></span></dt>
<dt><span class="section"><a href="fusion/extension/sequence_facade.html">Sequence Facade</a></span></dt>
<dt><span class="section"><a href="fusion/extension/iterator_facade.html">Iterator Facade</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/functional.html">Functional</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/functional/concepts.html">Concepts</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/functional/concepts/callable.html"> Callable Object</a></span></dt>
<dt><span class="section"><a href="fusion/functional/concepts/reg_callable.html"> Regular Callable
Object</a></span></dt>
<dt><span class="section"><a href="fusion/functional/concepts/def_callable.html"> Deferred
Callable Object</a></span></dt>
<dt><span class="section"><a href="fusion/functional/concepts/poly.html"> Polymorphic Function
Object</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/functional/invocation.html">Invocation</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/functional/invocation/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/functional/invocation/metafunctions.html">Metafunctions</a></span></dt>
<dt><span class="section"><a href="fusion/functional/invocation/limits.html">Limits</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/functional/adapters.html"> Adapters</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/functional/adapters/fused.html">fused</a></span></dt>
<dt><span class="section"><a href="fusion/functional/adapters/fused_procedure.html">fused_procedure</a></span></dt>
<dt><span class="section"><a href="fusion/functional/adapters/fused_function_object.html">fused_function_object</a></span></dt>
<dt><span class="section"><a href="fusion/functional/adapters/unfused.html">unfused</a></span></dt>
<dt><span class="section"><a href="fusion/functional/adapters/unfused_typed.html">unfused_typed</a></span></dt>
<dt><span class="section"><a href="fusion/functional/adapters/limits.html">Limits</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="fusion/functional/generation.html">Generation</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="fusion/functional/generation/functions.html">Functions</a></span></dt>
<dt><span class="section"><a href="fusion/functional/generation/metafunctions.html">Metafunctions</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="fusion/notes.html">Notes</a></span></dt>
<dt><span class="section"><a href="fusion/change_log.html">Change log</a></span></dt>
<dt><span class="section"><a href="fusion/acknowledgements.html">Acknowledgements</a></span></dt>
<dt><span class="section"><a href="fusion/references.html">References</a></span></dt>
</dl>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: March 21, 2011 at 04:01:58 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
<div class="spirit-nav"><a accesskey="n" href="fusion/preface.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
</body>
</html> </html>

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -160,6 +161,8 @@ the following invariants always hold:
* __std_pair__ iterator * __std_pair__ iterator
* __boost_array__ iterator * __boost_array__ iterator
* __vector__ iterator * __vector__ iterator
* __map__ iterator
* __single_view__ iterator
* __iterator_range__ (where adapted sequence is a __bidirectional_sequence__) * __iterator_range__ (where adapted sequence is a __bidirectional_sequence__)
* __transform_view__ (where adapted sequence is a __bidirectional_sequence__) * __transform_view__ (where adapted sequence is a __bidirectional_sequence__)
* __reverse_view__ * __reverse_view__
@ -204,8 +207,10 @@ the following expressions must be valid:
[heading Models] [heading Models]
* __vector__ iterator * __vector__ iterator
* __map__ iterator
* __std_pair__ iterator * __std_pair__ iterator
* __boost_array__ iterator * __boost_array__ iterator
* __single_view__ iterator
* __iterator_range__ iterator (where adapted sequence is a __random_access_sequence__) * __iterator_range__ iterator (where adapted sequence is a __random_access_sequence__)
* __transform_view__ iterator (where adapted sequence is a __random_access_sequence__) * __transform_view__ iterator (where adapted sequence is a __random_access_sequence__)
* __reverse_view__ iterator (where adapted sequence is a __random_access_sequence__) * __reverse_view__ iterator (where adapted sequence is a __random_access_sequence__)

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Copyright (C) 2010 Christopher Schmidt Copyright (C) 2010 Christopher Schmidt
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -188,7 +189,9 @@ are not defined in __forward_sequence__.
* __std_pair__ * __std_pair__
* __boost_array__ * __boost_array__
* __vector__ * __vector__
* __map__
* __reverse_view__ * __reverse_view__
* __single_view__
* __iterator_range__ (where adapted sequence is a Bidirectional Sequence) * __iterator_range__ (where adapted sequence is a Bidirectional Sequence)
* __transform_view__ (where adapted sequence is a Bidirectional Sequence) * __transform_view__ (where adapted sequence is a Bidirectional Sequence)
* __zip_view__ (where adapted sequences are models of Bidirectional Sequence) * __zip_view__ (where adapted sequences are models of Bidirectional Sequence)
@ -263,7 +266,9 @@ are not defined in __bidirectional_sequence__.
* __std_pair__ * __std_pair__
* __boost_array__ * __boost_array__
* __vector__ * __vector__
* __map__
* __reverse_view__ * __reverse_view__
* __single_view__
* __iterator_range__ (where adapted sequence is a Random Access Sequence) * __iterator_range__ (where adapted sequence is a Random Access Sequence)
* __transform_view__ (where adapted sequence is a Random Access Sequence) * __transform_view__ (where adapted sequence is a Random Access Sequence)
* __zip_view__ (where adapted sequences are models of Random Access Sequence) * __zip_view__ (where adapted sequences are models of Random Access Sequence)
@ -1423,12 +1428,19 @@ operators for free.
[section I/O] [section I/O]
The I/O operators: `<<` and `>>` work generically on all Fusion sequences. The I/O operators: `<<` and `>>` work generically on all Fusion
The global `operator<<` has been overloaded for generic output streams such sequences. The I/O operators are overloaded in namespace `boost::fusion`
that __sequence__(s) are output by recursively calling `operator<<` for each [footnote __sequences__ and __views__ residing in different namespaces
element. Analogously, the global `operator>>` has been overloaded to will have to either provide their own I/O operators (possibly forwarding
extract __sequence__(s) from generic input streams by recursively calling to fusion's I/O operators) or hoist fusion's I/O operators (using
`operator>>` for each element. declaration), in their own namespaces for proper argument dependent
lookup.]
The `operator<<` has been overloaded for generic output streams such
that __sequence__(s) are output by recursively calling `operator<<` for
each element. Analogously, the global `operator>>` has been overloaded
to extract __sequence__(s) from generic input streams by recursively
calling `operator>>` for each element.
The default delimiter between the elements is space, and the __sequence__ The default delimiter between the elements is space, and the __sequence__
is enclosed in parenthesis. For Example: is enclosed in parenthesis. For Example:

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,5 +1,6 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -43,7 +44,7 @@ lazy nature make them very cheap to copy and be passed around by value.
[heading Model of] [heading Model of]
* __forward_sequence__ * __random_access_sequence__
[variablelist Notation [variablelist Notation
[[`S`] [A `single_view` type]] [[`S`] [A `single_view` type]]
@ -54,7 +55,7 @@ lazy nature make them very cheap to copy and be passed around by value.
[heading Expression Semantics] [heading Expression Semantics]
Semantics of an expression is defined only where it differs from, or is not Semantics of an expression is defined only where it differs from, or is not
defined in __forward_sequence__. defined in __random_access_sequence__.
[table [table
[[Expression] [Semantics]] [[Expression] [Semantics]]

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2006 Joel de Guzman Copyright (c) 2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2011 Nathan Ridge
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
@ -17,11 +18,10 @@
#include <boost/fusion/sequence/sequence_facade.hpp> #include <boost/fusion/sequence/sequence_facade.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp> #include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/fusion/sequence/intrinsic.hpp> #include <boost/fusion/sequence/intrinsic.hpp>
#include <boost/fusion/iterator.hpp> #include <boost/fusion/iterator.hpp>
#include <boost/fusion/support/category_of.hpp> #include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/mpl/int.hpp> #include <boost/mpl/int.hpp>
#include <boost/mpl/identity.hpp> #include <boost/mpl/identity.hpp>
@ -40,7 +40,8 @@ namespace demo
{ {
template<typename Seq, int N> template<typename Seq, int N>
struct triple_iterator struct triple_iterator
: fusion::iterator_facade<triple_iterator<Seq, N>, fusion::random_access_traversal_tag> : fusion::iterator_facade<triple_iterator<Seq, N>,
fusion::random_access_traversal_tag>
{ {
typedef mpl::int_<N> index; typedef mpl::int_<N> index;
typedef Seq sequence_type; typedef Seq sequence_type;
@ -74,13 +75,19 @@ namespace demo
template <typename Sq> template <typename Sq>
struct deref<triple_iterator<Sq, 0> > struct deref<triple_iterator<Sq, 0> >
{ {
typedef typename typedef typename Sq::t0_type& type;
mpl::if_<
boost::is_const<Sq> static type
, typename Sq::t0_type const& call(triple_iterator<Sq, 0> const& iter)
, typename Sq::t0_type& {
>::type return iter.seq_.t0;
type; }
};
template <typename Sq>
struct deref<triple_iterator<Sq, 0> const>
{
typedef typename Sq::t0_type const& type;
static type static type
call(triple_iterator<Sq, 0> const& iter) call(triple_iterator<Sq, 0> const& iter)
@ -92,13 +99,19 @@ namespace demo
template <typename Sq> template <typename Sq>
struct deref<triple_iterator<Sq, 1> > struct deref<triple_iterator<Sq, 1> >
{ {
typedef typename typedef typename Sq::t1_type& type;
mpl::if_<
boost::is_const<Sq> static type
, typename Sq::t1_type const& call(triple_iterator<Sq, 1> const& iter)
, typename Sq::t1_type& {
>::type return iter.seq_.t1;
type; }
};
template <typename Sq>
struct deref<triple_iterator<Sq, 1> const>
{
typedef typename Sq::t1_type const& type;
static type static type
call(triple_iterator<Sq, 1> const& iter) call(triple_iterator<Sq, 1> const& iter)
@ -110,13 +123,19 @@ namespace demo
template <typename Sq> template <typename Sq>
struct deref<triple_iterator<Sq, 2> > struct deref<triple_iterator<Sq, 2> >
{ {
typedef typename typedef typename Sq::t2_type& type;
mpl::if_<
boost::is_const<Sq> static type
, typename Sq::t2_type const& call(triple_iterator<Sq, 2> const& iter)
, typename Sq::t2_type& {
>::type return iter.seq_.t2;
type; }
};
template <typename Sq>
struct deref<triple_iterator<Sq, 2> const>
{
typedef typename Sq::t2_type const& type;
static type static type
call(triple_iterator<Sq, 2> const& iter) call(triple_iterator<Sq, 2> const& iter)
@ -129,7 +148,8 @@ namespace demo
struct next struct next
{ {
typedef triple_iterator< typedef triple_iterator<
typename It::sequence_type, It::index::value + 1> type; typename It::sequence_type, It::index::value + 1>
type;
static type call(It const& it) static type call(It const& it)
{ {
@ -141,7 +161,8 @@ namespace demo
struct prior struct prior
{ {
typedef triple_iterator< typedef triple_iterator<
typename It::sequence_type, It::index::value - 1> type; typename It::sequence_type, It::index::value - 1>
type;
static type call(It const& it) static type call(It const& it)
{ {
@ -152,7 +173,9 @@ namespace demo
template<typename It1, typename It2> template<typename It1, typename It2>
struct distance struct distance
{ {
typedef typename mpl::minus<typename It2::index, typename It1::index>::type type; typedef typename mpl::minus<
typename It2::index, typename It1::index>::type
type;
static type call(It1 const& it1, It2 const& it2) static type call(It1 const& it1, It2 const& it2)
{ {
@ -165,7 +188,8 @@ namespace demo
{ {
typedef triple_iterator< typedef triple_iterator<
typename It::sequence_type, typename It::sequence_type,
It::index::value + M::value> type; It::index::value + M::value>
type;
static type call(It const& it) static type call(It const& it)
{ {
@ -176,7 +200,8 @@ namespace demo
template<typename T0, typename T1, typename T2> template<typename T0, typename T1, typename T2>
struct triple struct triple
: fusion::sequence_facade<triple<T0, T1, T2>, fusion::random_access_traversal_tag> : fusion::sequence_facade<triple<T0, T1, T2>,
fusion::random_access_traversal_tag>
{ {
triple(T0 const& t0, T1 const& t1, T2 const& t2) triple(T0 const& t0, T1 const& t1, T2 const& t2)
: t0(t0), t1(t1), t2(t2) : t0(t0), t1(t1), t2(t2)
@ -185,8 +210,7 @@ namespace demo
template<typename Sq> template<typename Sq>
struct begin struct begin
{ {
typedef demo::triple_iterator< typedef demo::triple_iterator<Sq, 0> type;
Sq, 0> type;
static type call(Sq& sq) static type call(Sq& sq)
{ {
@ -197,8 +221,7 @@ namespace demo
template<typename Sq> template<typename Sq>
struct end struct end
{ {
typedef demo::triple_iterator< typedef demo::triple_iterator<Sq, 3> type;
Sq, 3> type;
static type call(Sq& sq) static type call(Sq& sq)
{ {
@ -300,6 +323,36 @@ namespace demo
}; };
} }
struct modifying_fold_functor
{
template <typename T>
struct result
{
typedef bool type;
};
template <typename T>
bool operator()(bool b, T&)
{
return b;
}
};
struct nonmodifying_fold_functor
{
template <typename T>
struct result
{
typedef bool type;
};
template <typename T>
bool operator()(bool b, const T&)
{
return b;
}
};
int main() int main()
{ {
typedef demo::triple<int, char, std::string> my_triple; typedef demo::triple<int, char, std::string> my_triple;
@ -309,11 +362,16 @@ int main()
BOOST_TEST(*fusion::prior(fusion::end(t)) == "hello"); BOOST_TEST(*fusion::prior(fusion::end(t)) == "hello");
BOOST_TEST(fusion::distance(fusion::begin(t), fusion::end(t)) == 3); BOOST_TEST(fusion::distance(fusion::begin(t), fusion::end(t)) == 3);
BOOST_TEST(fusion::size(t) == 3); BOOST_TEST(fusion::size(t) == 3);
BOOST_MPL_ASSERT((boost::is_same<int, fusion::result_of::value_at_c<my_triple, 0>::type>)); BOOST_MPL_ASSERT((boost::is_same<
BOOST_MPL_ASSERT((boost::is_same<char, fusion::result_of::value_at_c<my_triple, 1>::type>)); int, fusion::result_of::value_at_c<my_triple, 0>::type>));
BOOST_MPL_ASSERT((boost::is_same<std::string, fusion::result_of::value_at_c<my_triple, 2>::type>)); BOOST_MPL_ASSERT((boost::is_same<
char, fusion::result_of::value_at_c<my_triple, 1>::type>));
BOOST_MPL_ASSERT((boost::is_same<
std::string, fusion::result_of::value_at_c<my_triple, 2>::type>));
BOOST_TEST(fusion::at_c<0>(t) == 101); BOOST_TEST(fusion::at_c<0>(t) == 101);
BOOST_TEST(fusion::at_c<1>(t) == 'a'); BOOST_TEST(fusion::at_c<1>(t) == 'a');
BOOST_TEST(fusion::at_c<2>(t) == "hello"); BOOST_TEST(fusion::at_c<2>(t) == "hello");
BOOST_TEST(fusion::fold(t, true, modifying_fold_functor()) == true);
BOOST_TEST(fusion::fold(t, true, nonmodifying_fold_functor()) == true);
return boost::report_errors(); return boost::report_errors();
} }

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006-2007 Tobias Schwinger Copyright (c) 2006-2007 Tobias Schwinger
Use modification and distribution are subject to the Boost Software Use modification and distribution are subject to the Boost Software

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -0,0 +1,7 @@
wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=10 -DFUSION_MAX_LIST_SIZE=10 -DFUSION_MAX_ZIP_SEQUENCES=10 preprocess.cpp
wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=20 -DFUSION_MAX_LIST_SIZE=20 -DFUSION_MAX_ZIP_SEQUENCES=20 preprocess.cpp
wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=30 -DFUSION_MAX_LIST_SIZE=30 -DFUSION_MAX_ZIP_SEQUENCES=30 preprocess.cpp
wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=40 -DFUSION_MAX_LIST_SIZE=40 -DFUSION_MAX_ZIP_SEQUENCES=40 preprocess.cpp
wave @wave.cfg -DFUSION_MAX_VECTOR_SIZE=50 -DFUSION_MAX_LIST_SIZE=50 -DFUSION_MAX_ZIP_SEQUENCES=50 preprocess.cpp

10
preprocess/preprocess.cpp Normal file
View File

@ -0,0 +1,10 @@
/*=============================================================================
Copyright (c) 2011 Joel de Guzman
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/fusion/container.hpp>
#include <boost/fusion/algorithm.hpp>
#include <boost/fusion/tuple.hpp>

14
preprocess/wave.cfg Normal file
View File

@ -0,0 +1,14 @@
-DBOOST_FUSION_DONT_USE_PREPROCESSED_FILES
-DBOOST_FUSION_CREATE_PREPROCESSED_FILES
-SC:/dev/boost
-SC:/dev/tools/mingw/include
-SC:/dev/tools/mingw/lib/gcc/mingw32/4.5.2/include
-SC:/dev/tools/mingw/lib/gcc/mingw32/4.5.2/include/c++
-SC:/dev/tools/mingw/lib/gcc/mingw32/4.5.2/include/c++/mingw32
--variadics
-NBOOST_FUSION_ADAPT_TPL_STRUCT_NO_PARTIAL
-NBOOST_PROTO_USE_GET_POINTER
-NBOOST_PROTO_GET_POINTER
--timer

View File

@ -41,6 +41,10 @@ import testing ;
[ run algorithm/reverse_fold.cpp : : : : ] [ run algorithm/reverse_fold.cpp : : : : ]
[ run algorithm/reverse_iter_fold.cpp : : : : ] [ run algorithm/reverse_iter_fold.cpp : : : : ]
[ run algorithm/reverse.cpp : : : : ] [ run algorithm/reverse.cpp : : : : ]
[ run algorithm/segmented_for_each.cpp : : : : ]
[ run algorithm/segmented_find.cpp : : : : ]
[ run algorithm/segmented_find_if.cpp : : : : ]
[ run algorithm/segmented_fold.cpp : : : : ]
[ run algorithm/transform.cpp : : : : ] [ run algorithm/transform.cpp : : : : ]
[ run algorithm/join.cpp : : : : ] [ run algorithm/join.cpp : : : : ]
[ run algorithm/zip.cpp : : : : ] [ run algorithm/zip.cpp : : : : ]
@ -83,6 +87,7 @@ import testing ;
[ run sequence/map_tie.cpp : : : : ] [ run sequence/map_tie.cpp : : : : ]
[ run sequence/nview.cpp : : : : ] [ run sequence/nview.cpp : : : : ]
[ run sequence/reverse_view.cpp : : : : ] [ run sequence/reverse_view.cpp : : : : ]
[ run sequence/segmented_iterator_range.cpp : : : : ]
[ run sequence/set.cpp : : : : ] [ run sequence/set.cpp : : : : ]
[ run sequence/single_view.cpp : : : : ] [ run sequence/single_view.cpp : : : : ]
[ run sequence/std_pair.cpp : : : : ] [ run sequence/std_pair.cpp : : : : ]
@ -130,6 +135,7 @@ import testing ;
[ run sequence/define_assoc_struct.cpp : : : : ] [ run sequence/define_assoc_struct.cpp : : : : ]
[ run sequence/define_tpl_struct.cpp : : : : ] [ run sequence/define_tpl_struct.cpp : : : : ]
[ run sequence/define_assoc_tpl_struct.cpp : : : : ] [ run sequence/define_assoc_tpl_struct.cpp : : : : ]
[ run sequence/std_tuple_iterator.cpp : : : : ]
[ run functional/fused.cpp : : : : ] [ run functional/fused.cpp : : : : ]
[ run functional/fused_function_object.cpp : : : : ] [ run functional/fused_function_object.cpp : : : : ]
@ -149,17 +155,3 @@ import testing ;
; ;
} }
{
# Text for extension features, must be explicitly specified on the command line to be run
# TODO these are not in a test-suite because currently test-suites cannot be marked "explicit"
run algorithm/ext_/for_each_s.cpp ;
explicit for_each_s ;
run algorithm/ext_/find_if_s.cpp ;
explicit find_if_s ;
run sequence/ext_/iterator_range_s.cpp ;
explicit iterator_range_s ;
}

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005 Eric Niebler Copyright (c) 2005 Eric Niebler
Copyright (c) Dan Marsden Copyright (c) Dan Marsden

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005 Eric Niebler Copyright (c) 2005 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005 Eric Niebler Copyright (c) 2005 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -30,7 +30,7 @@ void test_set(Set const& set)
using namespace boost::fusion; using namespace boost::fusion;
std::cout << set << std::endl; std::cout << set << std::endl;
BOOST_STATIC_ASSERT(result_of::size<Set>::value == 3); BOOST_STATIC_ASSERT(boost::fusion::result_of::size<Set>::value == 3);
BOOST_TEST((*find<int>(set) == 1)); BOOST_TEST((*find<int>(set) == 1));
BOOST_TEST((*find<double>(set) == 1.5)); BOOST_TEST((*find<double>(set) == 1.5));
BOOST_TEST((*find<std::string>(set) == "hello")); BOOST_TEST((*find<std::string>(set) == "hello"));
@ -47,7 +47,7 @@ void test_map(Map const& map)
using namespace boost::fusion; using namespace boost::fusion;
std::cout << map << std::endl; std::cout << map << std::endl;
BOOST_STATIC_ASSERT(result_of::size<Map>::value == 3); BOOST_STATIC_ASSERT(boost::fusion::result_of::size<Map>::value == 3);
BOOST_TEST(((*find<_1>(map)).second == 1)); BOOST_TEST(((*find<_1>(map)).second == 1));
BOOST_TEST(((*find<_3>(map)).second == 1.5)); BOOST_TEST(((*find<_3>(map)).second == 1.5));
BOOST_TEST(((*find<_4>(map)).second == std::string("hello"))); BOOST_TEST(((*find<_4>(map)).second == std::string("hello")));

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -59,7 +59,7 @@ struct sum
template<typename Self, typename State, typename T> template<typename Self, typename State, typename T>
struct result<Self(State,T)> struct result<Self(State,T)>
: fusion::result_of::make_pair< : boost::fusion::result_of::make_pair<
mpl::int_< mpl::int_<
boost::remove_reference< boost::remove_reference<
State State
@ -108,7 +108,7 @@ struct meta_sum
#ifdef BOOST_FUSION_TEST_ITER_FOLD #ifdef BOOST_FUSION_TEST_ITER_FOLD
typedef typename typedef typename
fusion::result_of::value_of< boost::fusion::result_of::value_of<
typename boost::remove_reference<T>::type typename boost::remove_reference<T>::type
>::type >::type
t; t;
@ -144,7 +144,7 @@ struct fold_test_n
{ {
mpl::range_c<int, 1, n+1> init_range; mpl::range_c<int, 1, n+1> init_range;
typename fusion::result_of::as_vector< typename boost::fusion::result_of::as_vector<
typename mpl::transform< typename mpl::transform<
range range
, mpl::always<int> , mpl::always<int>
@ -169,20 +169,20 @@ struct fold_test_n
{ {
typedef typename typedef typename
#ifdef BOOST_FUSION_TEST_REVERSE_FOLD #ifdef BOOST_FUSION_TEST_REVERSE_FOLD
fusion::result_of::as_vector< boost::fusion::result_of::as_vector<
typename mpl::copy< typename mpl::copy<
mpl::range_c<int, 1, n+1> mpl::range_c<int, 1, n+1>
, mpl::front_inserter<fusion::vector<> > , mpl::front_inserter<fusion::vector<> >
>::type >::type
>::type >::type
#else #else
fusion::result_of::as_vector<mpl::range_c<int, 1, n+1> >::type boost::fusion::result_of::as_vector<mpl::range_c<int, 1, n+1> >::type
#endif #endif
vec; vec;
typedef typedef
boost::is_same< boost::is_same<
typename fusion::result_of::BOOST_FUSION_TEST_FOLD_NAME< typename boost::fusion::result_of::BOOST_FUSION_TEST_FOLD_NAME<
vec vec
, mpl::vector<mpl::int_<1>, mpl::int_<0> > , mpl::vector<mpl::int_<1>, mpl::int_<0> >
, meta_sum , meta_sum

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,16 +1,23 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp> #include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/adapted/mpl.hpp> #include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/sequence/io/out.hpp> #include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp> #include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/container/generation/make_vector.hpp> #include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/container/generation/make_list.hpp>
#include <boost/fusion/algorithm/transformation/pop_back.hpp> #include <boost/fusion/algorithm/transformation/pop_back.hpp>
#include <boost/fusion/algorithm/transformation/push_back.hpp>
#include <boost/fusion/algorithm/query/find.hpp>
#include <boost/fusion/include/back.hpp>
#include <boost/fusion/include/array.hpp>
#include <boost/array.hpp>
#include <boost/mpl/vector_c.hpp> #include <boost/mpl/vector_c.hpp>
int int
@ -41,6 +48,57 @@ main()
BOOST_TEST((boost::fusion::pop_back(mpl_vec()) == make_vector(1, 2, 3, 4))); BOOST_TEST((boost::fusion::pop_back(mpl_vec()) == make_vector(1, 2, 3, 4)));
} }
{
list<int, int> l(1, 2);
std::cout << pop_back(l) << std::endl;
BOOST_TEST((pop_back(l) == make_list(1)));
}
{ // make sure empty sequences are OK
list<int> l(1);
std::cout << pop_back(l) << std::endl;
BOOST_TEST((pop_back(l) == make_list()));
}
{
single_view<int> sv(1);
std::cout << pop_back(sv) << std::endl;
// Compile check only
begin(pop_back(sv)) == end(sv);
end(pop_back(sv)) == begin(sv);
}
// $$$ JDG: TODO add compile fail facility $$$
//~ { // compile fail check (Disabled for now)
//~ list<> l;
//~ std::cout << pop_back(l) << std::endl;
//~ }
#ifndef BOOST_NO_AUTO_DECLARATIONS
{
auto vec = make_vector(1, 3.14, "hello");
// Compile check only
auto popv = pop_back(vec);
std::cout << popv << std::endl;
auto push = push_back(vec, 42);
auto pop = pop_back(vec);
auto i1 = find<int>(popv);
auto i2 = find<double>(pop);
BOOST_TEST(i1 != end(pop));
BOOST_TEST(i2 != end(pop));
BOOST_TEST(i1 != i2);
}
#endif
{
boost::array<std::size_t, 2> a = { 10, 50 };
BOOST_TEST(back(pop_back(a)) == 10);
}
return boost::report_errors(); return boost::report_errors();
} }

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -0,0 +1,62 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2011 Eric Niebler
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/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/algorithm/query/find.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include "../sequence/tree.hpp"
struct not_there {};
template<typename Tree>
void
process_tree(Tree const &tree)
{
using namespace boost;
typedef typename boost::fusion::result_of::find<Tree const, short>::type short_iter;
typedef typename boost::fusion::result_of::find<Tree const, float>::type float_iter;
typedef typename boost::fusion::result_of::find<Tree const, not_there>::type not_there_iter;
// find_if_s of a segmented data structure returns generic
// segmented iterators
short_iter si = fusion::find<short>(tree);
float_iter fi = fusion::find<float>(tree);
// they behave like ordinary Fusion iterators ...
BOOST_TEST((*si == short('d')));
BOOST_TEST((*fi == float(1)));
// Searching for something that's not there should return the end iterator.
not_there_iter nti = fusion::find<not_there>(tree);
BOOST_TEST((nti == fusion::end(tree)));
}
int
main()
{
using namespace boost::fusion;
process_tree(
make_tree(
make_vector(double(0),'B')
, make_tree(
make_vector(1,2,long(3))
, make_tree(make_vector('a','b','c'))
, make_tree(make_vector(short('d'),'e','f'))
)
, make_tree(
make_vector(4,5,6)
, make_tree(make_vector(float(1),'h','i'))
, make_tree(make_vector('j','k','l'))
)
)
);
return boost::report_errors();
}

View File

@ -0,0 +1,65 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2011 Eric Niebler
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/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/algorithm/query/find_if.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/type_traits/is_same.hpp>
#include "../sequence/tree.hpp"
struct not_there {};
template<typename Tree>
void
process_tree(Tree const &tree)
{
using namespace boost;
using mpl::_;
typedef typename boost::fusion::result_of::find_if<Tree const, is_same<_,short> >::type short_iter;
typedef typename boost::fusion::result_of::find_if<Tree const, is_same<_,float> >::type float_iter;
typedef typename boost::fusion::result_of::find_if<Tree const, is_same<_,not_there> >::type not_there_iter;
// find_if of a segmented data structure returns generic
// segmented iterators
short_iter si = fusion::find_if<is_same<_,short> >(tree);
float_iter fi = fusion::find_if<is_same<_,float> >(tree);
// they behave like ordinary Fusion iterators ...
BOOST_TEST((*si == short('d')));
BOOST_TEST((*fi == float(1)));
// Searching for something that's not there should return the end iterator.
not_there_iter nti = fusion::find_if<is_same<_,not_there> >(tree);
BOOST_TEST((nti == fusion::end(tree)));
}
int
main()
{
using namespace boost::fusion;
process_tree(
make_tree(
make_vector(double(0),'B')
, make_tree(
make_vector(1,2,long(3))
, make_tree(make_vector('a','b','c'))
, make_tree(make_vector(short('d'),'e','f'))
)
, make_tree(
make_vector(4,5,6)
, make_tree(make_vector(float(1),'h','i'))
, make_tree(make_vector('j','k','l'))
)
)
);
return boost::report_errors();
}

View File

@ -0,0 +1,63 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2011 Eric Niebler
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 <string>
#include <sstream>
#include <iostream>
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include "../sequence/tree.hpp"
struct write_string
{
typedef std::ostream* result_type;
template<typename T>
std::ostream* operator()(std::ostream* sout, T const& t) const
{
return &(*sout << t << " ");
}
};
template<typename Tree>
void
process_tree(Tree const &tree)
{
using namespace boost;
std::stringstream str;
fusion::fold(tree, &str, write_string());
std::string res = str.str();
BOOST_TEST_EQ(res, "a b c 1 2 3 100 e f 0 B 1 h i 4 5 6 j k l ");
}
int
main()
{
using namespace boost::fusion;
process_tree(
make_tree(
make_vector(double(0),'B')
, make_tree(
make_vector(1,2,long(3))
, make_tree(make_vector('a','b','c'))
, make_tree(make_vector(short('d'),'e','f'))
)
, make_tree(
make_vector(4,5,6)
, make_tree(make_vector(float(1),'h','i'))
, make_tree(make_vector('j','k','l'))
)
)
);
return boost::report_errors();
}

View File

@ -0,0 +1,49 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2011 Eric Niebler
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/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include "../sequence/tree.hpp"
struct print
{
template <typename T>
void operator()(T const& v) const
{
std::cout << "[ " << v << " ] ";
}
};
int
main()
{
using namespace boost::fusion;
{
for_each(
make_tree(
make_vector(double(0),'B')
, make_tree(
make_vector(1,2,long(3))
, make_tree(make_vector('a','b','c'))
, make_tree(make_vector(short('d'),'e','f'))
)
, make_tree(
make_vector(4,5,6)
, make_tree(make_vector(float(1),'h','i'))
, make_tree(make_vector('j','k','l'))
)
)
, print()
);
}
return boost::report_errors();
}

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden Copyright (c) 2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
@ -109,46 +109,46 @@ main()
{ {
typedef range_c<int, 5, 9> sequence_type; typedef range_c<int, 5, 9> sequence_type;
sequence_type sequence; sequence_type sequence;
std::cout << transform(sequence, square()) << std::endl; std::cout << boost::fusion::transform(sequence, square()) << std::endl;
BOOST_TEST((transform(sequence, square()) == make_vector(25, 36, 49, 64))); BOOST_TEST((boost::fusion::transform(sequence, square()) == make_vector(25, 36, 49, 64)));
} }
{ {
typedef range_c<int, 5, 9> mpl_list1; typedef range_c<int, 5, 9> mpl_list1;
std::cout << transform(mpl_list1(), square()) << std::endl; std::cout << boost::fusion::transform(mpl_list1(), square()) << std::endl;
BOOST_TEST((transform(mpl_list1(), square()) == make_vector(25, 36, 49, 64))); BOOST_TEST((boost::fusion::transform(mpl_list1(), square()) == make_vector(25, 36, 49, 64)));
} }
{ {
vector<int, int, int> tup(1, 2, 3); vector<int, int, int> tup(1, 2, 3);
std::cout << transform(tup, square()) << std::endl; std::cout << boost::fusion::transform(tup, square()) << std::endl;
BOOST_TEST((transform(tup, square()) == make_vector(1, 4, 9))); BOOST_TEST((boost::fusion::transform(tup, square()) == make_vector(1, 4, 9)));
} }
{ {
vector<int, int, int> tup1(1, 2, 3); vector<int, int, int> tup1(1, 2, 3);
vector<int, int, int> tup2(4, 5, 6); vector<int, int, int> tup2(4, 5, 6);
std::cout << transform(tup1, tup2, add()) << std::endl; std::cout << boost::fusion::transform(tup1, tup2, add()) << std::endl;
BOOST_TEST((transform(tup1, tup2, add()) == make_vector(5, 7, 9))); BOOST_TEST((boost::fusion::transform(tup1, tup2, add()) == make_vector(5, 7, 9)));
} }
{ {
// Unary transform that requires lvalues, just check compilation // Unary transform that requires lvalues, just check compilation
vector<int, int, int> tup1(1, 2, 3); vector<int, int, int> tup1(1, 2, 3);
BOOST_TEST(at_c<0>(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); BOOST_TEST(at_c<0>(boost::fusion::transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1));
BOOST_TEST(*begin(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); BOOST_TEST(*begin(boost::fusion::transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1));
} }
{ {
vector<int, int, int> tup1(1, 2, 3); vector<int, int, int> tup1(1, 2, 3);
vector<int, int, int> tup2(4, 5, 6); vector<int, int, int> tup2(4, 5, 6);
BOOST_TEST(at_c<0>(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); BOOST_TEST(at_c<0>(boost::fusion::transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1));
BOOST_TEST(*begin(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); BOOST_TEST(*begin(boost::fusion::transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1));
} }
{ {
vector<int, int, int> tup1(1, 2, 3); vector<int, int, int> tup1(1, 2, 3);
BOOST_TEST(transform(tup1, twice) == make_vector(2,4,6)); BOOST_TEST(boost::fusion::transform(tup1, twice) == make_vector(2,4,6));
} }

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@ -38,17 +38,17 @@ namespace
fusion::at_c<8>(v); fusion::at_c<8>(v);
fusion::at_c<9>(v); fusion::at_c<9>(v);
typedef typename fusion::result_of::value_at_c<v_type, 0>::type va0; typedef typename boost::fusion::result_of::value_at_c<v_type, 0>::type va0;
typedef typename fusion::result_of::value_at_c<v_type, 1>::type va1; typedef typename boost::fusion::result_of::value_at_c<v_type, 1>::type va1;
typedef typename fusion::result_of::value_at_c<v_type, 2>::type va2; typedef typename boost::fusion::result_of::value_at_c<v_type, 2>::type va2;
typedef typename fusion::result_of::value_at_c<v_type, 3>::type va3; typedef typename boost::fusion::result_of::value_at_c<v_type, 3>::type va3;
typedef typename fusion::result_of::value_at_c<v_type, 4>::type va4; typedef typename boost::fusion::result_of::value_at_c<v_type, 4>::type va4;
typedef typename fusion::result_of::value_at_c<v_type, 5>::type va5; typedef typename boost::fusion::result_of::value_at_c<v_type, 5>::type va5;
typedef typename fusion::result_of::value_at_c<v_type, 6>::type va6; typedef typename boost::fusion::result_of::value_at_c<v_type, 6>::type va6;
typedef typename fusion::result_of::value_at_c<v_type, 7>::type va7; typedef typename boost::fusion::result_of::value_at_c<v_type, 7>::type va7;
typedef typename fusion::result_of::value_at_c<v_type, 8>::type va8; typedef typename boost::fusion::result_of::value_at_c<v_type, 8>::type va8;
typedef typename fusion::result_of::value_at_c<v_type, 9>::type va9; typedef typename boost::fusion::result_of::value_at_c<v_type, 9>::type va9;
fusion::begin(v); fusion::begin(v);
fusion::end(v); fusion::end(v);

View File

@ -331,7 +331,7 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>)
template <class Sequence> template <class Sequence>
void test_sequence(Sequence & seq) void test_sequence(Sequence & seq)
{ {
test_sequence_n(seq, mpl::int_<fusion::result_of::size<Sequence>::value>()); test_sequence_n(seq, mpl::int_<boost::fusion::result_of::size<Sequence>::value>());
} }
@ -340,18 +340,18 @@ void result_type_tests()
using boost::is_same; using boost::is_same;
BOOST_TEST(( is_same< BOOST_TEST(( is_same<
fusion::result_of::invoke<int (*)(), fusion::vector0<> >::type, int boost::fusion::result_of::invoke<int (*)(), fusion::vector0<> >::type, int
>::value )); >::value ));
// disabled until boost::result_of supports it // disabled until boost::result_of supports it
// BOOST_TEST(( is_same< // BOOST_TEST(( is_same<
// fusion::result_of::invoke<int (*)(...), fusion::vector1<int> >::type, int // boost::fusion::result_of::invoke<int (*)(...), fusion::vector1<int> >::type, int
// >::value )); // >::value ));
BOOST_TEST(( is_same< BOOST_TEST(( is_same<
fusion::result_of::invoke<int (members::*)(), fusion::vector1<members*> >::type, int boost::fusion::result_of::invoke<int (members::*)(), fusion::vector1<members*> >::type, int
>::value )); >::value ));
// disabled until boost::result_of supports it // disabled until boost::result_of supports it
// BOOST_TEST(( is_same< // BOOST_TEST(( is_same<
// fusion::result_of::invoke<int (members::*)(...), fusion::vector2<members*,int> >::type, int // boost::fusion::result_of::invoke<int (members::*)(...), fusion::vector2<members*,int> >::type, int
// >::value )); // >::value ));
} }

View File

@ -182,16 +182,16 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>)
template <class Sequence> template <class Sequence>
void test_sequence(Sequence & seq) void test_sequence(Sequence & seq)
{ {
test_sequence_n(seq, mpl::int_<fusion::result_of::size<Sequence>::value>()); test_sequence_n(seq, mpl::int_<boost::fusion::result_of::size<Sequence>::value>());
} }
void result_type_tests() void result_type_tests()
{ {
using boost::is_same; using boost::is_same;
BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< nullary_fobj, fusion::vector<> >::type, int >::value )); BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< nullary_fobj, fusion::vector<> >::type, int >::value ));
BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector<element1_type> >::type, int >::value )); BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< fobj, fusion::vector<element1_type> >::type, int >::value ));
BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector<element1_type,element2_type> >::type, int >::value )); BOOST_TEST(( is_same< boost::fusion::result_of::invoke_function_object< fobj, fusion::vector<element1_type,element2_type> >::type, int >::value ));
} }

View File

@ -244,7 +244,7 @@ void test_sequence_n(Sequence & seq, mpl::int_<3>)
template <class Sequence> template <class Sequence>
void test_sequence(Sequence & seq) void test_sequence(Sequence & seq)
{ {
test_sequence_n(seq, mpl::int_<fusion::result_of::size<Sequence>::value>()); test_sequence_n(seq, mpl::int_<boost::fusion::result_of::size<Sequence>::value>());
} }
int main() int main()

View File

@ -63,7 +63,7 @@ int main()
test_func<> f; test_func<> f;
test_func<noncopyable> f_nc; test_func<noncopyable> f_nc;
fusion::result_of::make_fused< test_func<> >::type fused_func boost::fusion::result_of::make_fused< test_func<> >::type fused_func
= fusion::make_fused(f); = fusion::make_fused(f);
BOOST_TEST(fused_func(lv_vec) == 1); BOOST_TEST(fused_func(lv_vec) == 1);

View File

@ -73,7 +73,7 @@ int main()
test_func<> f; test_func<> f;
test_func<noncopyable> f_nc; test_func<noncopyable> f_nc;
fusion::result_of::make_fused_function_object< test_func<> >::type fused_func boost::fusion::result_of::make_fused_function_object< test_func<> >::type fused_func
= fusion::make_fused_function_object(f); = fusion::make_fused_function_object(f);
BOOST_TEST(fused_func(lv_vec) == 1); BOOST_TEST(fused_func(lv_vec) == 1);

View File

@ -69,7 +69,7 @@ int main()
test_func<> f; test_func<> f;
test_func<noncopyable> f_nc; test_func<noncopyable> f_nc;
fusion::result_of::make_fused_procedure< test_func<> >::type fused_func boost::fusion::result_of::make_fused_procedure< test_func<> >::type fused_func
= fusion::make_fused_procedure(f); = fusion::make_fused_procedure(f);
CHECK_EFFECT(fused_func(lv_vec), 1); CHECK_EFFECT(fused_func(lv_vec), 1);

View File

@ -42,7 +42,7 @@ struct test_func
template <class Self, class Seq> template <class Self, class Seq>
struct result< Self(Seq &) > struct result< Self(Seq &) >
: mpl::if_< mpl::and_< fusion::result_of::empty<Seq>, RemoveNullary >, : mpl::if_< mpl::and_< boost::fusion::result_of::empty<Seq>, RemoveNullary >,
boost::blank, mpl::identity<long> >::type boost::blank, mpl::identity<long> >::type
{ }; { };
@ -86,14 +86,14 @@ int main()
test_func<> f; test_func<> f;
test_func<noncopyable> f_nc; test_func<noncopyable> f_nc;
fusion::result_of::make_unfused< test_func<> >::type unfused_func = boost::fusion::result_of::make_unfused< test_func<> >::type unfused_func =
fusion::make_unfused(f); fusion::make_unfused(f);
fusion::result_of::make_unfused< boost::reference_wrapper< boost::fusion::result_of::make_unfused< boost::reference_wrapper<
test_func<noncopyable> > >::type unfused_func_ref = test_func<noncopyable> > >::type unfused_func_ref =
fusion::make_unfused(ref(f_nc)); fusion::make_unfused(ref(f_nc));
fusion::result_of::make_unfused< boost::reference_wrapper< boost::fusion::result_of::make_unfused< boost::reference_wrapper<
test_func<noncopyable> const> >::type unfused_func_c_ref = test_func<noncopyable> const> >::type unfused_func_c_ref =
fusion::make_unfused(cref(f_nc)); fusion::make_unfused(cref(f_nc));

View File

@ -92,7 +92,6 @@ main()
{ {
using namespace boost::fusion; using namespace boost::fusion;
using namespace boost; using namespace boost;
using namespace std;
std::cout << tuple_open('['); std::cout << tuple_open('[');
std::cout << tuple_close(']'); std::cout << tuple_close(']');
@ -111,8 +110,8 @@ main()
at_c<1>(p) = 9; at_c<1>(p) = 9;
BOOST_TEST(p == make_vector(6, 9)); BOOST_TEST(p == make_vector(6, 9));
BOOST_STATIC_ASSERT(result_of::size<ns::point>::value == 2); BOOST_STATIC_ASSERT(boost::fusion::result_of::size<ns::point>::value == 2);
BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty<ns::point>::value);
BOOST_TEST(front(p) == 6); BOOST_TEST(front(p) == 6);
BOOST_TEST(back(p) == 9); BOOST_TEST(back(p) == 9);
@ -149,7 +148,7 @@ main()
{ {
BOOST_MPL_ASSERT((mpl::is_sequence<ns::point>)); BOOST_MPL_ASSERT((mpl::is_sequence<ns::point>));
BOOST_MPL_ASSERT((boost::is_same< BOOST_MPL_ASSERT((boost::is_same<
fusion::result_of::value_at_c<ns::point,0>::type boost::fusion::result_of::value_at_c<ns::point,0>::type
, mpl::front<ns::point>::type>)); , mpl::front<ns::point>::type>));
} }
@ -167,8 +166,8 @@ main()
at_c<1>(p) = 9; at_c<1>(p) = 9;
BOOST_TEST(p == make_vector(6, 9)); BOOST_TEST(p == make_vector(6, 9));
BOOST_STATIC_ASSERT(result_of::size<ns::point_with_private_members>::value == 2); BOOST_STATIC_ASSERT(boost::fusion::result_of::size<ns::point_with_private_members>::value == 2);
BOOST_STATIC_ASSERT(!result_of::empty<ns::point_with_private_members>::value); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty<ns::point_with_private_members>::value);
BOOST_TEST(front(p) == 6); BOOST_TEST(front(p) == 6);
BOOST_TEST(back(p) == 9); BOOST_TEST(back(p) == 9);
@ -178,22 +177,22 @@ main()
{ {
BOOST_MPL_ASSERT(( BOOST_MPL_ASSERT((
boost::is_same< boost::is_same<
result_of::front<ns::point>::type, boost::fusion::result_of::front<ns::point>::type,
boost::fusion::extension::adt_attribute_proxy<ns::point,0,false> boost::fusion::extension::adt_attribute_proxy<ns::point,0,false>
>)); >));
BOOST_MPL_ASSERT(( BOOST_MPL_ASSERT((
boost::is_same< boost::is_same<
result_of::front<ns::point>::type::type, boost::fusion::result_of::front<ns::point>::type::type,
int int
>)); >));
BOOST_MPL_ASSERT(( BOOST_MPL_ASSERT((
boost::is_same< boost::is_same<
result_of::front<ns::point const>::type, boost::fusion::result_of::front<ns::point const>::type,
boost::fusion::extension::adt_attribute_proxy<ns::point,0,true> boost::fusion::extension::adt_attribute_proxy<ns::point,0,true>
>)); >));
BOOST_MPL_ASSERT(( BOOST_MPL_ASSERT((
boost::is_same< boost::is_same<
result_of::front<ns::point const>::type::type, boost::fusion::result_of::front<ns::point const>::type::type,
int int
>)); >));
} }

View File

@ -64,7 +64,6 @@ main()
{ {
using namespace boost::fusion; using namespace boost::fusion;
using namespace boost; using namespace boost;
using namespace std;
std::cout << tuple_open('['); std::cout << tuple_open('[');
std::cout << tuple_close(']'); std::cout << tuple_close(']');
@ -84,8 +83,8 @@ main()
at_c<1>(p) = 9; at_c<1>(p) = 9;
BOOST_TEST(p == make_vector(6, 9)); BOOST_TEST(p == make_vector(6, 9));
BOOST_STATIC_ASSERT(result_of::size<adapted::point>::value == 2); BOOST_STATIC_ASSERT(boost::fusion::result_of::size<adapted::point>::value == 2);
BOOST_STATIC_ASSERT(!result_of::empty<adapted::point>::value); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty<adapted::point>::value);
BOOST_TEST(front(p) == 6); BOOST_TEST(front(p) == 6);
BOOST_TEST(back(p) == 9); BOOST_TEST(back(p) == 9);
@ -128,7 +127,7 @@ main()
{ {
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::point>)); BOOST_MPL_ASSERT((mpl::is_sequence<adapted::point>));
BOOST_MPL_ASSERT((boost::is_same< BOOST_MPL_ASSERT((boost::is_same<
fusion::result_of::value_at_c<adapted::point,0>::type boost::fusion::result_of::value_at_c<adapted::point,0>::type
, mpl::front<adapted::point>::type>)); , mpl::front<adapted::point>::type>));
} }

Some files were not shown because too many files have changed in this diff Show More