mirror of
https://github.com/boostorg/iterator.git
synced 2026-01-27 06:52:14 +00:00
Compare commits
42 Commits
svn-tags/m
...
boost-1.31
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f69bef76cf | ||
|
|
1bed251dac | ||
|
|
afa62b3b29 | ||
|
|
60e24dfffa | ||
|
|
a2bfab9713 | ||
|
|
9ee673c283 | ||
|
|
4c5a9fe922 | ||
|
|
cbfbb116f4 | ||
|
|
8421fbc3ee | ||
|
|
28de0803e5 | ||
|
|
e17936284b | ||
|
|
6317b09a7c | ||
|
|
63cefe2d8f | ||
|
|
47c8138283 | ||
|
|
d15302e683 | ||
|
|
189533437f | ||
|
|
a4dbdcb00c | ||
|
|
be55d6db14 | ||
|
|
0069b61686 | ||
|
|
fd736d0def | ||
|
|
78831a2f67 | ||
|
|
7f164fea93 | ||
|
|
1c5454ba96 | ||
|
|
62ecb49bb5 | ||
|
|
c90b123e7a | ||
|
|
5d71ddeec4 | ||
|
|
cce82ba2c2 | ||
|
|
4576a34820 | ||
|
|
ace1b2c7e3 | ||
|
|
183c32f112 | ||
|
|
7b199b7b45 | ||
|
|
f05bfdccb7 | ||
|
|
c65ab1a129 | ||
|
|
129e9151f7 | ||
|
|
6379561eb0 | ||
|
|
f1d694c2d6 | ||
|
|
556175ea08 | ||
|
|
cf068fba24 | ||
|
|
f5d1feb76e | ||
|
|
3b8c0a6025 | ||
|
|
05a3df17e2 | ||
|
|
44065357e6 |
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
# Copyright David Abrahams 2004. Use, modification and distribution is
|
||||
# subject to 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)
|
||||
|
||||
#
|
||||
# Generate html, TeX, and PDF versions of all the source files
|
||||
@@ -16,7 +13,7 @@ if 0:
|
||||
for s in sources:
|
||||
syscmd('boosthtml %s' % s)
|
||||
else:
|
||||
extensions = ('html', 'pdf')
|
||||
extensions = ('html', 'tex', 'pdf')
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
extensions = sys.argv[1:]
|
||||
@@ -26,7 +23,7 @@ else:
|
||||
for s in sources
|
||||
]
|
||||
|
||||
print 'make %s' % ' '.join(all)
|
||||
syscmd('make %s' % ' '.join(all))
|
||||
print 'make -k %s' % ' '.join(all)
|
||||
syscmd('make -k %s' % ' '.join(all))
|
||||
|
||||
|
||||
|
||||
@@ -152,10 +152,9 @@ in <tt class="literal"><span class="pre">indirect_iterator</span></tt>.</li>
|
||||
<li><a class="reference" href="iterator_traits.html"><tt class="literal"><span class="pre">iterator_traits.hpp</span></tt></a> (<a class="reference" href="iterator_traits.pdf">PDF</a>): Provides <a class="reference" href="../../mpl/doc/index.html">MPL</a>-compatible metafunctions which
|
||||
retrieve an iterator's traits. Also corrects for the deficiencies
|
||||
of broken implementations of <tt class="literal"><span class="pre">std::iterator_traits</span></tt>.</li>
|
||||
<li><a class="reference" href="interoperable.html"><tt class="literal"><span class="pre">interoperable.hpp</span></tt></a> (<a class="reference" href="interoperable.pdf">PDF</a>): Provides an <a class="reference" href="../../mpl/doc/index.html">MPL</a>-compatible metafunction for
|
||||
testing iterator interoperability</li>
|
||||
</ul>
|
||||
<!-- * |interoperable|_ (PDF__): Provides an MPL_\ -compatible metafunction for
|
||||
testing iterator interoperability -->
|
||||
<!-- comment! __ interoperable.pdf -->
|
||||
</div>
|
||||
<div class="section" id="testing-and-concept-checking">
|
||||
<h2><a class="toc-backref" href="#id27" name="testing-and-concept-checking">Testing and Concept Checking</a></h2>
|
||||
|
||||
@@ -212,8 +212,8 @@ Traits
|
||||
retrieve an iterator's traits. Also corrects for the deficiencies
|
||||
of broken implementations of ``std::iterator_traits``.
|
||||
|
||||
.. * |interoperable|_ (PDF__): Provides an MPL_\ -compatible metafunction for
|
||||
testing iterator interoperability
|
||||
* |interoperable|_ (PDF__): Provides an MPL_\ -compatible metafunction for
|
||||
testing iterator interoperability
|
||||
|
||||
.. |pointee| replace:: ``pointee.hpp``
|
||||
.. _pointee: pointee.html
|
||||
@@ -225,7 +225,7 @@ __ iterator_traits.pdf
|
||||
|
||||
.. |interoperable| replace:: ``interoperable.hpp``
|
||||
.. _interoperable: interoperable.html
|
||||
.. comment! __ interoperable.pdf
|
||||
__ interoperable.pdf
|
||||
|
||||
.. _MPL: ../../mpl/doc/index.html
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
<title>Iterator Archetype</title>
|
||||
<meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" />
|
||||
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, Zephyr Associates, Inc." />
|
||||
<meta name="date" content="2004-01-27" />
|
||||
<meta name="date" content="2004-01-16" />
|
||||
<meta name="copyright" content="Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2004. All rights reserved" />
|
||||
<link rel="stylesheet" href="default.css" type="text/css" />
|
||||
</head>
|
||||
@@ -26,7 +26,7 @@
|
||||
<td><a class="first reference" href="http://www.boost-consulting.com">Boost Consulting</a>, Indiana University <a class="reference" href="http://www.osl.iu.edu">Open Systems
|
||||
Lab</a>, <a class="last reference" href="http://www.styleadvisor.com">Zephyr Associates, Inc.</a></td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
<td>2004-01-27</td></tr>
|
||||
<td>2004-01-16</td></tr>
|
||||
<tr><th class="docinfo-name">Copyright:</th>
|
||||
<td>Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2004. All rights reserved</td></tr>
|
||||
</tbody>
|
||||
@@ -35,11 +35,7 @@ Lab</a>, <a class="last reference" href="http://www.styleadvisor.com">Zephyr Ass
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">abstract:</th><td class="field-body">The <tt class="literal"><span class="pre">iterator_archetype</span></tt> class constructs a minimal implementation of
|
||||
one of the iterator access concepts and one of the iterator traversal concepts.
|
||||
This is used for doing a compile-time check to see if a the type requirements
|
||||
of a template are really enough to cover the implementation of the template.
|
||||
For further information see the documentation for the <a class="reference" href="../../concept_check/index.html"><tt class="literal"><span class="pre">boost::concept_check</span></tt></a> library.</td>
|
||||
<tr class="field"><th class="field-name">abstract:</th><td class="field-body">iterator archetypes provide a means to check the compile time requirements of a generic component on its iterator arguments.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Binary file not shown.
@@ -13,15 +13,7 @@
|
||||
.. _`Open Systems Lab`: http://www.osl.iu.edu
|
||||
.. _`Zephyr Associates, Inc.`: http://www.styleadvisor.com
|
||||
|
||||
:abstract: The ``iterator_archetype`` class constructs a minimal implementation of
|
||||
one of the iterator access concepts and one of the iterator traversal concepts.
|
||||
This is used for doing a compile-time check to see if a the type requirements
|
||||
of a template are really enough to cover the implementation of the template.
|
||||
For further information see the documentation for the |concepts|_ library.
|
||||
|
||||
.. |concepts| replace:: ``boost::concept_check``
|
||||
.. _concepts: ../../concept_check/index.html
|
||||
|
||||
:abstract: iterator archetypes provide a means to check the compile time requirements of a generic component on its iterator arguments.
|
||||
|
||||
.. contents:: Table of Contents
|
||||
|
||||
@@ -186,4 +178,4 @@ The nested trait types are defined as follows:
|
||||
|
||||
2. X is convertible to TraversalCategory
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -21,7 +21,7 @@
|
||||
<tr><th class="docinfo-name">Author:</th>
|
||||
<td>David Abrahams</td></tr>
|
||||
<tr><th class="docinfo-name">Contact:</th>
|
||||
<td><a class="first last reference" href="mailto:dave@boost-consulting.com">dave@boost-consulting.com</a></td></tr>
|
||||
<td><a class="first reference" href="mailto:dave@boost-consulting.com">dave@boost-consulting.com</a>, <a class="reference" href="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</a>, <a class="last reference" href="mailto:witt@ive.uni-hannover.de">witt@ive.uni-hannover.de</a></td></tr>
|
||||
<tr><th class="docinfo-name">Organization:</th>
|
||||
<td><a class="first last reference" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
|
||||
@@ -10,11 +10,4 @@ test-suite iterator_examples
|
||||
[ run node_iterator1.cpp ]
|
||||
[ run node_iterator2.cpp ]
|
||||
[ run node_iterator3.cpp ]
|
||||
[ run counting_iterator_example.cpp ]
|
||||
[ run filter_iterator_example.cpp ]
|
||||
[ run function_output_iterator_example.cpp ]
|
||||
[ run indirect_iterator_example.cpp ]
|
||||
[ run permutation_iterator_example.cpp ]
|
||||
[ run reverse_iterator_example.cpp ]
|
||||
[ run transform_iterator_example.cpp ]
|
||||
;
|
||||
|
||||
@@ -26,9 +26,7 @@ namespace boost {
|
||||
typedef void pointer;
|
||||
typedef void reference;
|
||||
|
||||
explicit function_output_iterator() {}
|
||||
|
||||
explicit function_output_iterator(const UnaryFunction& f)
|
||||
explicit function_output_iterator(const UnaryFunction& f = UnaryFunction())
|
||||
: m_f(f) {}
|
||||
|
||||
struct output_proxy {
|
||||
|
||||
@@ -107,8 +107,13 @@ struct iterator_facade_default_category
|
||||
// check for readability
|
||||
, is_convertible<Reference, ValueParam>
|
||||
>
|
||||
, mpl::identity<std::input_iterator_tag>
|
||||
, mpl::identity<Traversal>
|
||||
, mpl::if_<
|
||||
iterator_writability_disabled<ValueParam,Reference>
|
||||
, std::input_iterator_tag
|
||||
, input_output_iterator_tag
|
||||
>
|
||||
|
||||
, mpl::identity<std::output_iterator_tag>
|
||||
>
|
||||
>
|
||||
{
|
||||
|
||||
@@ -27,11 +27,7 @@ namespace boost {
|
||||
//
|
||||
// Traversal Categories
|
||||
//
|
||||
|
||||
struct no_traversal_tag {};
|
||||
|
||||
struct incrementable_traversal_tag
|
||||
: no_traversal_tag {};
|
||||
struct incrementable_traversal_tag {};
|
||||
|
||||
struct single_pass_traversal_tag
|
||||
: incrementable_traversal_tag {};
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
subproject libs/iterator/test ;
|
||||
|
||||
subinclude libs/iterator/example ;
|
||||
|
||||
import testing ;
|
||||
|
||||
test-suite iterator
|
||||
@@ -33,11 +35,10 @@ test-suite iterator
|
||||
|
||||
[ run unit_tests.cpp ]
|
||||
[ run concept_tests.cpp ]
|
||||
[ compile-fail lvalue_concept_fail_expected.cpp ]
|
||||
[ run iterator_adaptor_cc.cpp ]
|
||||
[ run iterator_adaptor_test.cpp ]
|
||||
[ compile iterator_archetype_cc.cpp ]
|
||||
[ compile-fail iterator_archetype_default_ctor.cpp ]
|
||||
[ compile-fail lvalue_concept_fail_expected.cpp ]
|
||||
[ run transform_iterator_test.cpp ]
|
||||
[ run indirect_iterator_test.cpp ]
|
||||
[ compile indirect_iterator_member_types.cpp ]
|
||||
@@ -57,5 +58,5 @@ test-suite iterator
|
||||
[ run ../../utility/reverse_iterator_example.cpp ]
|
||||
[ run ../../utility/transform_iterator_example.cpp ]
|
||||
[ run ../../utility/iterator_traits_test.cpp ]
|
||||
[ run ../../utility/shared_iterator_test.cpp ]
|
||||
|
||||
;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// Copyright Thomas Witt 2004. Permission to copy, use,
|
||||
// modify, sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided
|
||||
// "as is" without express or implied warranty, and with no claim as
|
||||
// to its suitability for any purpose.
|
||||
//
|
||||
#include <boost/iterator/iterator_archetypes.hpp>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
int
|
||||
, boost::iterator_archetypes::readable_iterator_t
|
||||
, boost::single_pass_traversal_tag
|
||||
> iter;
|
||||
|
||||
// single_pass_traversal iterators are not required to be
|
||||
// default constructible
|
||||
iter it;
|
||||
}
|
||||
@@ -82,6 +82,86 @@ int main( void )
|
||||
size_t num_successful_tests = 0;
|
||||
size_t num_failed_tests = 0;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Make sure tuples are supported
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::cout << "Basic tuple support: "
|
||||
<< std::flush;
|
||||
|
||||
typedef boost::tuples::tuple<int, double> mytuple;
|
||||
mytuple t1;
|
||||
boost::tuples::get<0>(t1) = 42;
|
||||
boost::tuples::get<1>(t1) = 42.1;
|
||||
|
||||
if( 2 == boost::tuples::length<mytuple>::value &&
|
||||
42 == boost::tuples::get<0>(t1) &&
|
||||
42.1 == boost::tuples::get<1>(t1)
|
||||
)
|
||||
{
|
||||
++num_successful_tests;
|
||||
std::cout << "OK" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
++num_failed_tests = 0;
|
||||
std::cout << "not OK" << std::endl;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Make sure iterator adaptor is supported
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::cout << "Basic iterator adaptor support: "
|
||||
<< std::flush;
|
||||
|
||||
std::set<int> s;
|
||||
s.insert(42);
|
||||
s.insert(43);
|
||||
s.insert(44);
|
||||
|
||||
typedef boost::transform_iterator<
|
||||
std::binder1st<std::plus<int> >,
|
||||
std::set<int>::iterator
|
||||
>
|
||||
add_seven_iterator;
|
||||
|
||||
typedef boost::transform_iterator<
|
||||
std::binder1st<std::plus<int> >,
|
||||
std::set<int>::const_iterator
|
||||
>
|
||||
const_add_seven_iterator;
|
||||
|
||||
add_seven_iterator set_run(s.begin(), std::bind1st(std::plus<int>(), 7));
|
||||
add_seven_iterator set_end(s.end(), std::bind1st(std::plus<int>(), 7));
|
||||
|
||||
const_add_seven_iterator const_set_run(s.begin(), std::bind1st(std::plus<int>(), 7));
|
||||
// set_run = const_set_run; // Error: can't convert from const to non-const
|
||||
const_set_run = set_run;
|
||||
|
||||
if( 49 == *set_run &&
|
||||
50 == *++set_run &&
|
||||
51 == *++set_run &&
|
||||
set_end == ++set_run &&
|
||||
49 == *const_set_run &&
|
||||
50 == *++const_set_run &&
|
||||
51 == *++const_set_run &&
|
||||
set_end == ++const_set_run
|
||||
)
|
||||
{
|
||||
++num_successful_tests;
|
||||
std::cout << "OK" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
++num_failed_tests = 0;
|
||||
std::cout << "not OK" << std::endl;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Zip iterator construction and dereferencing
|
||||
|
||||
Reference in New Issue
Block a user