Compare commits

..

5 Commits

Author SHA1 Message Date
b498667808 Create a branch for inspect fixes.
[SVN r61439]
2010-04-20 21:11:27 +00:00
ac522bc9e1 category of each component iterator is reduced to a known category before we try to find a minimum.
Closes #1517


[SVN r58012]
2009-11-28 18:53:43 +00:00
4c60e26bf8 Made sure that iterator_facade's nested `::pointer` type is always
the same as what's returned from operator->.  For input iterators,
that wasn't always the case (see operator_arrow_proxy).

Fixes #1019.


[SVN r57989]
2009-11-28 05:12:29 +00:00
d11c7a3ec4 rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back
[SVN r56942]
2009-10-17 02:07:38 +00:00
76fd8e27fb Copyrights on CMakeLists.txt to keep them from clogging up the inspect
reports.  This is essentially the same commit as r55095 on the release
branch.



[SVN r55159]
2009-07-26 00:49:56 +00:00
7 changed files with 43 additions and 71 deletions

View File

@ -1,24 +0,0 @@
#----------------------------------------------------------------------------
# This file was automatically generated from the original CMakeLists.txt file
# Add a variable to hold the headers for the library
set (lib_headers
iterator.hpp
iterator
)
# Add a library target to the build system
boost_library_project(
iterator
# SRCDIRS
TESTDIRS test
HEADERS ${lib_headers}
# DOCDIRS
DESCRIPTION "A system of concepts which extend the C++ standard iterator requirementsand a framework of components for building iterators based on these extended concepts and includes several useful iterator adaptors."
MODULARIZED
AUTHORS "David Abrahams <dave -at- boostpro.com>"
"Jeremy Siek <jeremy.siek -at- gmail.com>"
"Thomas Witt <witt - at - acm.org>"
# MAINTAINERS
)

View File

@ -105,6 +105,7 @@ namespace boost
typedef typename remove_const<ValueParam>::type value_type;
// Not the real associated pointer type
typedef typename mpl::eval_if<
boost::detail::iterator_writability_disabled<ValueParam,Reference>
, add_pointer<const value_type>
@ -617,6 +618,12 @@ namespace boost
Value, CategoryOrTraversal, Reference, Difference
> associated_types;
typedef boost::detail::operator_arrow_result<
typename associated_types::value_type
, Reference
, typename associated_types::pointer
> pointer_;
protected:
// For use by derived classes
typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
@ -626,7 +633,9 @@ namespace boost
typedef typename associated_types::value_type value_type;
typedef Reference reference;
typedef Difference difference_type;
typedef typename associated_types::pointer pointer;
typedef typename pointer_::type pointer;
typedef typename associated_types::iterator_category iterator_category;
reference operator*() const
@ -634,18 +643,9 @@ namespace boost
return iterator_core_access::dereference(this->derived());
}
typename boost::detail::operator_arrow_result<
value_type
, reference
, pointer
>::type
operator->() const
pointer operator->() const
{
return boost::detail::operator_arrow_result<
value_type
, reference
, pointer
>::make(*this->derived());
return pointer_::make(*this->derived());
}
typename boost::detail::operator_brackets_result<Derived,Value,reference>::type

View File

@ -357,7 +357,7 @@ namespace boost {
{
typedef typename tuple_impl_specific::tuple_meta_transform<
IteratorTuple
, iterator_traversal<>
, pure_traversal_tag<iterator_traversal<> >
>::type tuple_of_traversal_tags;
typedef typename tuple_impl_specific::tuple_meta_accumulate<

View File

@ -1 +0,0 @@
boost_module(iterator DEPENDS mpl type_traits function concept_check)

View File

@ -1,33 +0,0 @@
boost_additional_test_dependencies(iterator BOOST_DEPENDS test tuple smart_ptr)
# These first two tests will run last, and are expected to fail
# for many less-capable compilers.
boost_test_compile_fail(interoperable_fail)
# test uses expected success, so that we catch unrelated
# compilation problems.
boost_test_run(is_convertible_fail)
boost_test_run(zip_iterator_test)
# These tests should work for just about everything.
boost_test_compile(is_lvalue_iterator)
boost_test_compile(is_readable_iterator)
boost_test_compile(pointee)
boost_test_run(unit_tests)
boost_test_run(concept_tests)
boost_test_run(iterator_adaptor_cc)
boost_test_run(iterator_adaptor_test)
boost_test_compile(iterator_archetype_cc)
boost_test_compile_fail(iter_archetype_default_ctor)
boost_test_compile_fail(lvalue_concept_fail)
boost_test_run(transform_iterator_test)
boost_test_run(indirect_iterator_test)
boost_test_compile(indirect_iter_member_types)
boost_test_run(filter_iterator_test)
boost_test_run(iterator_facade)
boost_test_run(reverse_iterator_test)
boost_test_run(counting_iterator_test)
boost_test_run(interoperable)
boost_test_run(iterator_traits_test)
boost_test_run(permutation_iterator_test)

View File

@ -87,6 +87,10 @@ struct input_iter
}
};
template <class T, class U>
void same_type(U const&)
{ BOOST_MPL_ASSERT((boost::is_same<T,U>)); }
int main()
{
int state = 0;
@ -101,6 +105,8 @@ int main()
input_iter p;
(*p).mutator();
p->mutator();
same_type<input_iter::pointer>(p.operator->());
return boost::report_errors();
}

View File

@ -46,6 +46,7 @@
#include <vector>
#include <list>
#include <set>
#include <string>
#include <functional>
#include <boost/tuple/tuple.hpp>
#include <boost/iterator/transform_iterator.hpp>
@ -60,6 +61,27 @@ struct pure_traversal
typename boost::iterator_traversal<It>::type
>
{};
/// Tests for https://svn.boost.org/trac/boost/ticket/1517
int to_value(int const &v)
{
return v;
}
void category_test()
{
std::list<int> rng1;
std::string rng2;
boost::make_zip_iterator(
boost::make_tuple(
boost::make_transform_iterator(rng1.begin(), &to_value), // BidirectionalInput
rng2.begin() // RandomAccess
)
);
}
///
/////////////////////////////////////////////////////////////////////////////
//
@ -70,6 +92,8 @@ struct pure_traversal
int main( void )
{
category_test();
std::cout << "\n"
<< "***********************************************\n"
<< "* *\n"