mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-09 15:13:54 +00:00
Trim trailing spaces.
This commit is contained in:
parent
c2929ea6c6
commit
80ec58bb3b
@ -41,12 +41,12 @@ int main(int, char*[])
|
||||
|
||||
// Use indirect iterator to print out numbers by accessing
|
||||
// them through the array of pointers.
|
||||
std::cout << "indirectly printing out the numbers from 0 to "
|
||||
std::cout << "indirectly printing out the numbers from 0 to "
|
||||
<< N << std::endl;
|
||||
std::copy(boost::make_indirect_iterator(pointers.begin()),
|
||||
boost::make_indirect_iterator(pointers.end()),
|
||||
std::ostream_iterator<int>(std::cout, " "));
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
@ -19,10 +19,10 @@ int main()
|
||||
{
|
||||
int numbers_[] = { 0, -1, 4, -3, 5, 8, -2 };
|
||||
const int N = sizeof(numbers_)/sizeof(int);
|
||||
|
||||
|
||||
typedef int* base_iterator;
|
||||
base_iterator numbers(numbers_);
|
||||
|
||||
|
||||
// Example using make_filter_iterator()
|
||||
std::copy(boost::make_filter_iterator<is_positive_number>(numbers, numbers + N),
|
||||
boost::make_filter_iterator<is_positive_number>(numbers + N, numbers + N),
|
||||
@ -32,7 +32,7 @@ int main()
|
||||
// Example using filter_iterator
|
||||
typedef boost::filter_iterator<is_positive_number, base_iterator>
|
||||
FilterIter;
|
||||
|
||||
|
||||
is_positive_number predicate;
|
||||
FilterIter filter_iter_first(predicate, numbers, numbers + N);
|
||||
FilterIter filter_iter_last(predicate, numbers + N, numbers + N);
|
||||
@ -45,15 +45,15 @@ int main()
|
||||
boost::make_filter_iterator(
|
||||
boost::bind(std::greater<int>(), boost::placeholders::_1, -2)
|
||||
, numbers, numbers + N)
|
||||
|
||||
|
||||
, boost::make_filter_iterator(
|
||||
boost::bind(std::greater<int>(), boost::placeholders::_1, -2)
|
||||
, numbers + N, numbers + N)
|
||||
|
||||
|
||||
, std::ostream_iterator<int>(std::cout, " ")
|
||||
);
|
||||
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ struct string_appender
|
||||
string_appender(std::string& s)
|
||||
: m_str(&s)
|
||||
{}
|
||||
|
||||
|
||||
void operator()(const std::string& x) const
|
||||
{
|
||||
*m_str += x;
|
||||
@ -37,9 +37,9 @@ int main(int, char*[])
|
||||
x.push_back("!");
|
||||
|
||||
std::string s = "";
|
||||
std::copy(x.begin(), x.end(),
|
||||
std::copy(x.begin(), x.end(),
|
||||
boost::make_function_output_iterator(string_appender(s)));
|
||||
|
||||
|
||||
std::cout << s << std::endl;
|
||||
|
||||
return 0;
|
||||
|
@ -21,13 +21,13 @@ int main(int, char*[])
|
||||
pointers_to_chars[i] = &characters[i];
|
||||
|
||||
// Example of using indirect_iterator
|
||||
|
||||
|
||||
boost::indirect_iterator<char**, char>
|
||||
indirect_first(pointers_to_chars), indirect_last(pointers_to_chars + N);
|
||||
|
||||
std::copy(indirect_first, indirect_last, std::ostream_iterator<char>(std::cout, ","));
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
|
||||
// Example of making mutable and constant indirect iterators
|
||||
|
||||
@ -48,13 +48,13 @@ int main(int, char*[])
|
||||
std::ostream_iterator<char>(std::cout, ","));
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
|
||||
// Example of using make_indirect_iterator()
|
||||
|
||||
std::copy(boost::make_indirect_iterator(pointers_to_chars),
|
||||
std::copy(boost::make_indirect_iterator(pointers_to_chars),
|
||||
boost::make_indirect_iterator(pointers_to_chars + N),
|
||||
std::ostream_iterator<char>(std::cout, ","));
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ int main()
|
||||
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
|
||||
std::auto_ptr<node<int> > nodes(new node<int>(42));
|
||||
|
||||
|
||||
#else
|
||||
|
||||
std::unique_ptr<node<int> > nodes(new node<int>(42));
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
nodes->append(new node<std::string>(" is greater than "));
|
||||
@ -30,7 +30,7 @@ int main()
|
||||
, std::ostream_iterator<node_base>(std::cout, " ")
|
||||
);
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
std::for_each(
|
||||
node_iterator(nodes.get()), node_iterator()
|
||||
, std::mem_fun_ref(&node_base::double_me)
|
||||
|
@ -16,11 +16,11 @@ int main()
|
||||
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
|
||||
std::auto_ptr<node<int> > nodes(new node<int>(42));
|
||||
|
||||
|
||||
#else
|
||||
|
||||
std::unique_ptr<node<int> > nodes(new node<int>(42));
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
nodes->append(new node<std::string>(" is greater than "));
|
||||
@ -29,16 +29,16 @@ int main()
|
||||
// Check interoperability
|
||||
assert(node_iterator(nodes.get()) == node_const_iterator(nodes.get()));
|
||||
assert(node_const_iterator(nodes.get()) == node_iterator(nodes.get()));
|
||||
|
||||
|
||||
assert(node_iterator(nodes.get()) != node_const_iterator());
|
||||
assert(node_const_iterator(nodes.get()) != node_iterator());
|
||||
|
||||
|
||||
std::copy(
|
||||
node_iterator(nodes.get()), node_iterator()
|
||||
, std::ostream_iterator<node_base>(std::cout, " ")
|
||||
);
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
std::for_each(
|
||||
node_iterator(nodes.get()), node_iterator()
|
||||
, boost::mem_fn(&node_base::double_me)
|
||||
|
@ -16,11 +16,11 @@ int main()
|
||||
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
|
||||
std::auto_ptr<node<int> > nodes(new node<int>(42));
|
||||
|
||||
|
||||
#else
|
||||
|
||||
std::unique_ptr<node<int> > nodes(new node<int>(42));
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
nodes->append(new node<std::string>(" is greater than "));
|
||||
@ -29,16 +29,16 @@ int main()
|
||||
// Check interoperability
|
||||
assert(node_iterator(nodes.get()) == node_const_iterator(nodes.get()));
|
||||
assert(node_const_iterator(nodes.get()) == node_iterator(nodes.get()));
|
||||
|
||||
|
||||
assert(node_iterator(nodes.get()) != node_const_iterator());
|
||||
assert(node_const_iterator(nodes.get()) != node_iterator());
|
||||
|
||||
|
||||
std::copy(
|
||||
node_iterator(nodes.get()), node_iterator()
|
||||
, std::ostream_iterator<node_base>(std::cout, " ")
|
||||
);
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
std::for_each(
|
||||
node_iterator(nodes.get()), node_iterator()
|
||||
, boost::mem_fn(&node_base::double_me)
|
||||
|
@ -27,7 +27,7 @@ int main() {
|
||||
*el_it = std::distance(elements.begin(), el_it);
|
||||
|
||||
index_type indices( index_size );
|
||||
for(index_type::iterator i_it = indices.begin() ; i_it != indices.end() ; ++i_it )
|
||||
for(index_type::iterator i_it = indices.begin() ; i_it != indices.end() ; ++i_it )
|
||||
*i_it = element_range_size - index_size + std::distance(indices.begin(), i_it);
|
||||
std::reverse( indices.begin(), indices.end() );
|
||||
|
||||
|
@ -15,13 +15,13 @@ int main(int, char*[])
|
||||
const int N = sizeof(letters_)/sizeof(char) - 1;
|
||||
typedef char* base_iterator;
|
||||
base_iterator letters(letters_);
|
||||
|
||||
|
||||
std::cout << "original sequence of letters:\t\t\t"
|
||||
<< letters_ << std::endl;
|
||||
|
||||
// Use reverse_iterator to print a sequence of letters in reverse
|
||||
// order.
|
||||
|
||||
|
||||
boost::reverse_iterator<base_iterator>
|
||||
reverse_letters_first(letters + N),
|
||||
reverse_letters_last(letters);
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2003 The Trustees of Indiana University.
|
||||
|
||||
// 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
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@ -16,14 +16,14 @@ typedef boost::shared_container_iterator< std::vector<int> > iterator;
|
||||
void set_range(iterator& i, iterator& end) {
|
||||
|
||||
boost::shared_ptr< std::vector<int> > ints(new std::vector<int>());
|
||||
|
||||
|
||||
ints->push_back(0);
|
||||
ints->push_back(1);
|
||||
ints->push_back(2);
|
||||
ints->push_back(3);
|
||||
ints->push_back(4);
|
||||
ints->push_back(5);
|
||||
|
||||
|
||||
i = iterator(ints->begin(),ints);
|
||||
end = iterator(ints->end(),ints);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2003 The Trustees of Indiana University.
|
||||
|
||||
// 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
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@ -36,7 +36,7 @@ int main() {
|
||||
print_range_nl(boost::make_shared_container_iterator(ints->begin(),ints),
|
||||
boost::make_shared_container_iterator(ints->end(),ints));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2003 The Trustees of Indiana University.
|
||||
|
||||
// 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
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include "boost/shared_ptr.hpp"
|
||||
#include "boost/tuple/tuple.hpp" // for boost::tie
|
||||
#include <algorithm> // for std::copy
|
||||
#include <iostream>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ int main() {
|
||||
|
||||
|
||||
iterator i,end;
|
||||
|
||||
|
||||
boost::tie(i,end) = return_range();
|
||||
|
||||
std::copy(i,end,std::ostream_iterator<int>(std::cout,","));
|
||||
|
@ -1,4 +1,4 @@
|
||||
// (C) Copyright Jeremy Siek 2000-2004.
|
||||
// (C) Copyright Jeremy Siek 2000-2004.
|
||||
// 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)
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class Operation>
|
||||
template <class Operation>
|
||||
class binder1st {
|
||||
public:
|
||||
typedef typename Operation::result_type result_type;
|
||||
@ -70,6 +70,6 @@ main(int, char*[])
|
||||
boost::make_transform_iterator(x + N, boost::bind1st(std::plus<int>(), 4)),
|
||||
std::ostream_iterator<int>(std::cout, " "));
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ main()
|
||||
boost::iterator_traversal<new_iterator>::type tc;
|
||||
boost::random_access_traversal_tag derived = tc;
|
||||
(void)derived;
|
||||
|
||||
|
||||
boost::function_requires<
|
||||
boost_concepts::WritableIteratorConcept<int*> >();
|
||||
boost::function_requires<
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <stdlib.h>
|
||||
#ifndef __BORLANDC__
|
||||
# include <boost/tuple/tuple.hpp>
|
||||
#endif
|
||||
#endif
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
@ -94,13 +94,13 @@ void category_test(
|
||||
|
||||
// Pick a random position internal to the range
|
||||
difference_type offset = (unsigned)rand() % distance;
|
||||
|
||||
|
||||
#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
BOOST_TEST(offset >= 0);
|
||||
#else
|
||||
#else
|
||||
assert_nonnegative<difference_type>::test(offset);
|
||||
#endif
|
||||
|
||||
|
||||
CountingIterator internal = start;
|
||||
std::advance(internal, offset);
|
||||
|
||||
@ -111,7 +111,7 @@ void category_test(
|
||||
std::pair<CountingIterator,CountingIterator> xy(
|
||||
std::equal_range(start, finish, *internal));
|
||||
CountingIterator x = xy.first, y = xy.second;
|
||||
|
||||
|
||||
BOOST_TEST(boost::detail::distance(x, y) == 1);
|
||||
|
||||
// Show that values outside the range can't be found
|
||||
@ -122,7 +122,7 @@ void category_test(
|
||||
std::vector<value_type> v;
|
||||
for (value_type z = *start; !(z == *finish); ++z)
|
||||
v.push_back(z);
|
||||
|
||||
|
||||
// Note that this test requires a that the first argument is
|
||||
// dereferenceable /and/ a valid iterator prior to the first argument
|
||||
boost::random_access_iterator_test(start, v.size(), v.begin());
|
||||
@ -200,11 +200,11 @@ void test_container(Container* = 0) // default arg works around MSVC bug
|
||||
Container c(1 + (unsigned)rand() % 1673);
|
||||
|
||||
const typename Container::iterator start = c.begin();
|
||||
|
||||
|
||||
// back off by 1 to leave room for dereferenceable value at the end
|
||||
typename Container::iterator finish = start;
|
||||
std::advance(finish, c.size() - 1);
|
||||
|
||||
|
||||
test(start, finish);
|
||||
|
||||
typedef typename Container::const_iterator const_iterator;
|
||||
@ -283,14 +283,14 @@ int main()
|
||||
test_integer3<long, std::random_access_iterator_tag, int>();
|
||||
test_integer<my_int2>();
|
||||
test_integer<my_int3>();
|
||||
|
||||
|
||||
// Some tests on container iterators, to prove we handle a few different categories
|
||||
test_container<std::vector<int> >();
|
||||
test_container<std::list<int> >();
|
||||
# ifndef BOOST_NO_SLIST
|
||||
test_container<BOOST_STD_EXTENSION_NAMESPACE::slist<int> >();
|
||||
# endif
|
||||
|
||||
|
||||
// Also prove that we can handle raw pointers.
|
||||
int array[2000];
|
||||
test(boost::make_counting_iterator(array), boost::make_counting_iterator(array+2000-1));
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright David Abrahams 2003, Jeremy Siek 2004.
|
||||
// Copyright David Abrahams 2003, Jeremy Siek 2004.
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -18,7 +18,7 @@
|
||||
#include <iostream>
|
||||
|
||||
using boost::dummyT;
|
||||
|
||||
|
||||
struct one_or_four
|
||||
{
|
||||
bool operator()(dummyT x) const
|
||||
@ -116,7 +116,7 @@ int main()
|
||||
boost::function_requires< boost_concepts::WritableIteratorConcept<Iter> >();
|
||||
boost::function_requires< boost_concepts::SinglePassIteratorConcept<Iter> >();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
const dummyT
|
||||
@ -128,7 +128,7 @@ int main()
|
||||
boost::function_requires< boost_concepts::ReadableIteratorConcept<Iter> >();
|
||||
boost::function_requires< boost_concepts::ForwardTraversalConcept<Iter> >();
|
||||
}
|
||||
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) // Causes Internal Error in linker.
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
@ -165,7 +165,7 @@ int main()
|
||||
boost::function_requires< boost_concepts::LvalueIteratorConcept<Iter> >();
|
||||
boost::function_requires< boost_concepts::ForwardTraversalConcept<Iter> >();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
@ -178,7 +178,7 @@ int main()
|
||||
boost::function_requires< boost_concepts::ReadableIteratorConcept<Iter> >();
|
||||
boost::function_requires< boost_concepts::BidirectionalTraversalConcept<Iter> >();
|
||||
}
|
||||
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) // Causes Internal Error in linker.
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
@ -215,11 +215,11 @@ int main()
|
||||
boost::function_requires< boost_concepts::LvalueIteratorConcept<Iter> >();
|
||||
boost::function_requires< boost_concepts::BidirectionalTraversalConcept<Iter> >();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Run-time tests
|
||||
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT(3), dummyT(4), dummyT(5) };
|
||||
const int N = sizeof(array)/sizeof(dummyT);
|
||||
|
||||
@ -235,9 +235,9 @@ int main()
|
||||
, boost::random_access_traversal_tag
|
||||
>::value
|
||||
));
|
||||
|
||||
|
||||
//# endif
|
||||
|
||||
|
||||
// On compilers not supporting partial specialization, we can do more type
|
||||
// deduction with deque iterators than with pointers... unless the library
|
||||
// is broken ;-(
|
||||
@ -258,7 +258,7 @@ int main()
|
||||
, boost::make_reverse_iterator(array2.begin())
|
||||
),
|
||||
dummyT(4), dummyT(1));
|
||||
|
||||
|
||||
boost::bidirectional_readable_iterator_test(
|
||||
filter_iter(array+0, array+N),
|
||||
dummyT(1), dummyT(4));
|
||||
|
@ -55,7 +55,7 @@ int main()
|
||||
ones ones_generator;
|
||||
vector<int> values(10);
|
||||
generate(values.begin(), values.end(), ones());
|
||||
|
||||
|
||||
vector<int> generated;
|
||||
copy(
|
||||
boost::make_function_input_iterator(ones_generator, 0),
|
||||
|
@ -30,16 +30,16 @@ struct my_ptr {
|
||||
|
||||
// Borland 5.6.4 and earlier drop const all over the place, so this
|
||||
// test will fail in the lines marked with (**)
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef boost::indirect_iterator<int**> Iter;
|
||||
STATIC_ASSERT_SAME(Iter::value_type, int);
|
||||
STATIC_ASSERT_SAME(Iter::reference, int&);
|
||||
STATIC_ASSERT_SAME(Iter::pointer, int*);
|
||||
STATIC_ASSERT_SAME(Iter::reference, int&);
|
||||
STATIC_ASSERT_SAME(Iter::pointer, int*);
|
||||
STATIC_ASSERT_SAME(Iter::difference_type, std::ptrdiff_t);
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible<Iter::iterator_category,
|
||||
std::random_access_iterator_tag>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible<boost::iterator_traversal<Iter>::type,
|
||||
@ -54,13 +54,13 @@ int main()
|
||||
{
|
||||
typedef boost::indirect_iterator<int**, int> Iter;
|
||||
STATIC_ASSERT_SAME(Iter::value_type, int);
|
||||
STATIC_ASSERT_SAME(Iter::reference, int&);
|
||||
STATIC_ASSERT_SAME(Iter::pointer, int*);
|
||||
STATIC_ASSERT_SAME(Iter::reference, int&);
|
||||
STATIC_ASSERT_SAME(Iter::pointer, int*);
|
||||
}
|
||||
{
|
||||
typedef boost::indirect_iterator<int**, const int> Iter;
|
||||
STATIC_ASSERT_SAME(Iter::value_type, int);
|
||||
STATIC_ASSERT_SAME(Iter::reference, const int&);
|
||||
STATIC_ASSERT_SAME(Iter::reference, const int&);
|
||||
STATIC_ASSERT_SAME(Iter::pointer, const int*); // (**)
|
||||
}
|
||||
{
|
||||
@ -68,9 +68,9 @@ int main()
|
||||
STATIC_ASSERT_SAME(Iter::value_type, zow);
|
||||
STATIC_ASSERT_SAME(Iter::reference, const zow&); // (**)
|
||||
STATIC_ASSERT_SAME(Iter::pointer, const zow*); // (**)
|
||||
|
||||
|
||||
STATIC_ASSERT_SAME(Iter::difference_type, std::ptrdiff_t);
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible<Iter::iterator_category,
|
||||
std::random_access_iterator_tag>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible<boost::iterator_traversal<Iter>::type,
|
||||
@ -79,9 +79,9 @@ int main()
|
||||
{
|
||||
typedef boost::indirect_iterator<char**, int, std::random_access_iterator_tag, long&, short> Iter;
|
||||
STATIC_ASSERT_SAME(Iter::value_type, int);
|
||||
STATIC_ASSERT_SAME(Iter::reference, long&);
|
||||
STATIC_ASSERT_SAME(Iter::pointer, int*);
|
||||
STATIC_ASSERT_SAME(Iter::difference_type, short);
|
||||
STATIC_ASSERT_SAME(Iter::reference, long&);
|
||||
STATIC_ASSERT_SAME(Iter::pointer, int*);
|
||||
STATIC_ASSERT_SAME(Iter::difference_type, short);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_element_type, element_type, true)
|
||||
int
|
||||
main()
|
||||
{
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT(3), dummyT(4), dummyT(5) };
|
||||
const int N = sizeof(array)/sizeof(dummyT);
|
||||
|
||||
|
@ -38,7 +38,7 @@ struct noncopyable_iterator
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef boost::noncopyable* pointer;
|
||||
typedef boost::noncopyable& reference;
|
||||
|
||||
|
||||
boost::noncopyable const& operator*() const;
|
||||
};
|
||||
|
||||
@ -50,13 +50,13 @@ struct proxy_iterator
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
|
||||
|
||||
struct proxy
|
||||
{
|
||||
operator value_type&() const;
|
||||
proxy& operator=(value_type) const;
|
||||
};
|
||||
|
||||
|
||||
proxy operator*() const;
|
||||
};
|
||||
|
||||
@ -111,14 +111,14 @@ int main()
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<lvalue_iterator<char*> >::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<lvalue_iterator<float> >::value);
|
||||
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<constant_lvalue_iterator<v> >::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<constant_lvalue_iterator<int> >::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<constant_lvalue_iterator<char*> >::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<constant_lvalue_iterator<float> >::value);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator<v*>::value);
|
||||
BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator<v const*>::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator<std::deque<v>::iterator>::value);
|
||||
@ -131,18 +131,18 @@ int main()
|
||||
BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator<value_iterator>::value);
|
||||
#endif
|
||||
BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator<noncopyable_iterator>::value);
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator<lvalue_iterator<v> >::value);
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator<lvalue_iterator<int> >::value);
|
||||
#endif
|
||||
#endif
|
||||
BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator<lvalue_iterator<char*> >::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator<lvalue_iterator<float> >::value);
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator<constant_lvalue_iterator<v> >::value);
|
||||
BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator<constant_lvalue_iterator<int> >::value);
|
||||
BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator<constant_lvalue_iterator<char*> >::value);
|
||||
BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator<constant_lvalue_iterator<float> >::value);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ struct noncopyable_iterator
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef boost::noncopyable* pointer;
|
||||
typedef boost::noncopyable& reference;
|
||||
|
||||
|
||||
boost::noncopyable const& operator*() const;
|
||||
};
|
||||
|
||||
@ -49,13 +49,13 @@ struct proxy_iterator
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef v* pointer;
|
||||
typedef v& reference;
|
||||
|
||||
|
||||
struct proxy
|
||||
{
|
||||
operator v&();
|
||||
proxy& operator=(v) const;
|
||||
};
|
||||
|
||||
|
||||
proxy operator*() const;
|
||||
};
|
||||
|
||||
@ -66,12 +66,12 @@ struct proxy_iterator2
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef v* pointer;
|
||||
typedef v& reference;
|
||||
|
||||
|
||||
struct proxy
|
||||
{
|
||||
proxy& operator=(v) const;
|
||||
};
|
||||
|
||||
|
||||
proxy operator*() const;
|
||||
};
|
||||
|
||||
@ -87,10 +87,10 @@ int main()
|
||||
BOOST_STATIC_ASSERT(boost::is_readable_iterator<proxy_iterator>::value);
|
||||
BOOST_STATIC_ASSERT(!boost::is_readable_iterator<proxy_iterator2>::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_readable_iterator<value_iterator>::value);
|
||||
|
||||
|
||||
// Make sure inaccessible copy constructor doesn't prevent
|
||||
// readability
|
||||
BOOST_STATIC_ASSERT(boost::is_readable_iterator<noncopyable_iterator>::value);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -41,6 +41,6 @@ int main()
|
||||
boost::function_requires< boost_concepts::InteroperableIteratorConcept<rev_iter, c_rev_iter> >();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
||||
# include <boost/iterator/is_readable_iterator.hpp>
|
||||
# include <boost/iterator/is_lvalue_iterator.hpp>
|
||||
#endif
|
||||
#endif
|
||||
#include <boost/pending/iterator_tests.hpp>
|
||||
|
||||
# include <boost/core/lightweight_test.hpp>
|
||||
@ -58,7 +58,7 @@ struct ptr_iterator
|
||||
, boost::random_access_traversal_tag
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
, V&
|
||||
#endif
|
||||
#endif
|
||||
>
|
||||
{
|
||||
private:
|
||||
@ -69,9 +69,9 @@ private:
|
||||
, boost::random_access_traversal_tag
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
, V&
|
||||
#endif
|
||||
#endif
|
||||
> super_t;
|
||||
|
||||
|
||||
public:
|
||||
ptr_iterator() { }
|
||||
ptr_iterator(V* d) : super_t(d) { }
|
||||
@ -95,7 +95,7 @@ struct modify_traversal
|
||||
, Traversal
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
template <class T>
|
||||
struct fwd_iterator
|
||||
: boost::iterator_adaptor<
|
||||
@ -108,7 +108,7 @@ private:
|
||||
fwd_iterator<T>
|
||||
, boost::forward_iterator_archetype<T>
|
||||
> super_t;
|
||||
|
||||
|
||||
public:
|
||||
fwd_iterator() { }
|
||||
fwd_iterator(boost::forward_iterator_archetype<T> d) : super_t(d) { }
|
||||
@ -126,7 +126,7 @@ private:
|
||||
in_iterator<T>
|
||||
, boost::input_iterator_archetype_no_proxy<T>
|
||||
> super_t;
|
||||
|
||||
|
||||
public:
|
||||
in_iterator() { }
|
||||
in_iterator(boost::input_iterator_archetype_no_proxy<T> d) : super_t(d) { }
|
||||
@ -145,7 +145,7 @@ struct constant_iterator
|
||||
, Iter
|
||||
, typename std::iterator_traits<Iter>::value_type const
|
||||
> base_t;
|
||||
|
||||
|
||||
constant_iterator() {}
|
||||
constant_iterator(Iter it)
|
||||
: base_t(it) {}
|
||||
@ -181,7 +181,7 @@ int static_assert_traversal(Iter* = 0, Trav* = 0)
|
||||
int
|
||||
main()
|
||||
{
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT(3), dummyT(4), dummyT(5) };
|
||||
const int N = sizeof(array)/sizeof(dummyT);
|
||||
|
||||
@ -192,7 +192,7 @@ main()
|
||||
{
|
||||
ptr_iterator<dummyT> i(array);
|
||||
boost::random_access_iterator_test(i, N, array);
|
||||
|
||||
|
||||
ptr_iterator<const dummyT> j(array);
|
||||
boost::random_access_iterator_test(j, N, array);
|
||||
boost::const_nonconst_iterator_test(i, ++j);
|
||||
@ -210,25 +210,25 @@ main()
|
||||
test = static_assert_same<Iter1::difference_type, std::ptrdiff_t>::value;
|
||||
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible<Iter1::iterator_category, std::random_access_iterator_tag>::value));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
{
|
||||
// Test computation of default when the Value is const
|
||||
typedef ptr_iterator<int const> Iter1;
|
||||
test = static_assert_same<Iter1::value_type, int>::value;
|
||||
test = static_assert_same<Iter1::reference, const int&>::value;
|
||||
|
||||
|
||||
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
||||
BOOST_STATIC_ASSERT(boost::is_readable_iterator<Iter1>::value);
|
||||
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<Iter1>::value);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // borland drops constness
|
||||
test = static_assert_same<Iter1::pointer, int const*>::value;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
@ -240,24 +240,24 @@ main()
|
||||
test = static_assert_same<Iter::reference, int const&>::value;
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // borland drops constness
|
||||
test = static_assert_same<Iter::pointer, int const*>::value;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
|
||||
BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator<BaseIter>::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_lvalue_iterator<Iter>::value);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
typedef modify_traversal<BaseIter, boost::incrementable_traversal_tag> IncrementableIter;
|
||||
|
||||
static_assert_traversal<BaseIter,boost::random_access_traversal_tag>();
|
||||
static_assert_traversal<IncrementableIter,boost::incrementable_traversal_tag>();
|
||||
}
|
||||
|
||||
|
||||
// Test the iterator_adaptor
|
||||
{
|
||||
ptr_iterator<dummyT> i(array);
|
||||
boost::random_access_iterator_test(i, N, array);
|
||||
|
||||
|
||||
ptr_iterator<const dummyT> j(array);
|
||||
boost::random_access_iterator_test(j, N, array);
|
||||
boost::const_nonconst_iterator_test(i, ++j);
|
||||
@ -272,9 +272,9 @@ main()
|
||||
adaptor_type i(forward_iter);
|
||||
int zero = 0;
|
||||
if (zero) // don't do this, just make sure it compiles
|
||||
BOOST_TEST((*i).m_x == i->foo());
|
||||
BOOST_TEST((*i).m_x == i->foo());
|
||||
}
|
||||
|
||||
|
||||
// check operator-> with an input iterator
|
||||
{
|
||||
boost::input_iterator_archetype_no_proxy<dummyT> input_iter;
|
||||
@ -282,7 +282,7 @@ main()
|
||||
adaptor_type i(input_iter);
|
||||
int zero = 0;
|
||||
if (zero) // don't do this, just make sure it compiles
|
||||
BOOST_TEST((*i).m_x == i->foo());
|
||||
BOOST_TEST((*i).m_x == i->foo());
|
||||
}
|
||||
|
||||
// check that base_type is correct
|
||||
|
@ -21,7 +21,7 @@ int main()
|
||||
|
||||
boost::function_requires< boost_concepts::ReadableIteratorConcept<iter> >();
|
||||
boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
|
||||
}
|
||||
}
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
int
|
||||
@ -32,7 +32,7 @@ int main()
|
||||
boost::function_requires< boost_concepts::ReadableIteratorConcept<iter> >();
|
||||
boost::function_requires< boost_concepts::WritableIteratorConcept<iter> >();
|
||||
boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
|
||||
}
|
||||
}
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
const int // I don't like adding const to Value. It is redundant. -JGS
|
||||
@ -43,7 +43,7 @@ int main()
|
||||
boost::function_requires< boost_concepts::ReadableIteratorConcept<iter> >();
|
||||
boost::function_requires< boost_concepts::LvalueIteratorConcept<iter> >();
|
||||
boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
|
||||
}
|
||||
}
|
||||
{
|
||||
typedef boost::iterator_archetype<
|
||||
int
|
||||
@ -54,7 +54,7 @@ int main()
|
||||
boost::function_requires< boost_concepts::WritableIteratorConcept<iter> >();
|
||||
boost::function_requires< boost_concepts::LvalueIteratorConcept<iter> >();
|
||||
boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
|
||||
}
|
||||
}
|
||||
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ struct my_iterator1
|
||||
: boost::forward_iterator_helper<my_iterator1, char, long, const char*, const char&>
|
||||
{
|
||||
my_iterator1(const char* p) : m_p(p) {}
|
||||
|
||||
|
||||
bool operator==(const my_iterator1& rhs) const
|
||||
{ return this->m_p == rhs.m_p; }
|
||||
|
||||
@ -63,9 +63,9 @@ struct my_iterator2
|
||||
typedef const char* pointer;
|
||||
typedef const char& reference;
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
|
||||
|
||||
my_iterator2(const char* p) : m_p(p) {}
|
||||
|
||||
|
||||
bool operator==(const my_iterator2& rhs) const
|
||||
{ return this->m_p == rhs.m_p; }
|
||||
|
||||
@ -189,7 +189,7 @@ maybe_pointer_test<int*, int, std::ptrdiff_t, int*, int&, std::random_access_ite
|
||||
|
||||
non_pointer_test<my_iterator1, char, long, const char*, const char&, std::forward_iterator_tag>
|
||||
my_iterator1_test;
|
||||
|
||||
|
||||
non_pointer_test<my_iterator2, char, long, const char*, const char&, std::forward_iterator_tag>
|
||||
my_iterator2_test;
|
||||
|
||||
@ -205,7 +205,7 @@ int main()
|
||||
{
|
||||
std::list<int> l(length);
|
||||
BOOST_TEST(boost::detail::distance(l.begin(), l.end()) == length);
|
||||
|
||||
|
||||
std::vector<int> v(length);
|
||||
BOOST_TEST(boost::detail::distance(v.begin(), v.end()) == length);
|
||||
|
||||
|
@ -27,7 +27,7 @@ void iterop_test()
|
||||
{
|
||||
typedef boost::permutation_iterator< double*, int const* > permutation_type;
|
||||
typedef boost::permutation_iterator< double const*, int const* > permutation_const_type;
|
||||
|
||||
|
||||
BOOST_CONCEPT_ASSERT((
|
||||
boost_concepts::InteroperableIteratorConcept<
|
||||
permutation_type
|
||||
@ -58,7 +58,7 @@ void permutation_test()
|
||||
permutation_type begin = boost::make_permutation_iterator( elements.begin(), indices.begin() );
|
||||
permutation_type it = begin;
|
||||
permutation_type end = boost::make_permutation_iterator( elements.begin(), indices.end() );
|
||||
|
||||
|
||||
BOOST_CHECK( it == begin );
|
||||
BOOST_CHECK( it != end );
|
||||
|
||||
@ -70,7 +70,7 @@ void permutation_test()
|
||||
}
|
||||
|
||||
it = begin;
|
||||
for( int i1 = 0; i1 < index_size - 1 ; ++++i1, ++++it )
|
||||
for( int i1 = 0; i1 < index_size - 1 ; ++++i1, ++++it )
|
||||
{
|
||||
index_type::iterator i_it2 = indices.begin();
|
||||
std::advance( i_it2, i1 );
|
||||
@ -79,14 +79,14 @@ void permutation_test()
|
||||
|
||||
it = begin;
|
||||
std::advance(it, index_size);
|
||||
for( index_type::iterator i_it3 = indices.end(); it != begin; )
|
||||
for( index_type::iterator i_it3 = indices.end(); it != begin; )
|
||||
{
|
||||
BOOST_CHECK( *--it == elements[ *--i_it3 ] );
|
||||
}
|
||||
|
||||
|
||||
it = begin;
|
||||
std::advance(it, index_size);
|
||||
for( int i2 = 0; i2 < index_size - 1; i2+=2, --it )
|
||||
for( int i2 = 0; i2 < index_size - 1; i2+=2, --it )
|
||||
{
|
||||
index_type::iterator i_it4 = --indices.end();
|
||||
std::advance( i_it4, -i2 );
|
||||
|
@ -35,7 +35,7 @@ struct X {
|
||||
template <class T> operator T&() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
STATIC_ASSERT_SAME(boost::pointee<proxy_ref_ptr<int> >::type, int);
|
||||
@ -43,16 +43,16 @@ int main()
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<proxy_ref_ptr<int const> >::type, int const);
|
||||
STATIC_ASSERT_SAME(boost::pointee<proxy_ref_ptr<X const> >::type, X const);
|
||||
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<proxy_value_ptr<int> >::type, int const);
|
||||
STATIC_ASSERT_SAME(boost::pointee<proxy_value_ptr<X> >::type, X const);
|
||||
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<proxy_value_ptr<int const> >::type, int const);
|
||||
STATIC_ASSERT_SAME(boost::pointee<proxy_value_ptr<X const> >::type, X const);
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<int*>::type, int);
|
||||
STATIC_ASSERT_SAME(boost::pointee<int const*>::type, int const);
|
||||
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<X*>::type, X);
|
||||
STATIC_ASSERT_SAME(boost::pointee<X const*>::type, X const);
|
||||
|
||||
@ -60,7 +60,7 @@ int main()
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::auto_ptr<int> >::type, int);
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::auto_ptr<X> >::type, X);
|
||||
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::auto_ptr<int const> >::type, int const);
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::auto_ptr<X const> >::type, X const);
|
||||
|
||||
@ -68,7 +68,7 @@ int main()
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::unique_ptr<int> >::type, int);
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::unique_ptr<X> >::type, X);
|
||||
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::unique_ptr<int const> >::type, int const);
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::unique_ptr<X const> >::type, X const);
|
||||
|
||||
@ -76,7 +76,7 @@ int main()
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::list<int>::iterator >::type, int);
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::list<X>::iterator >::type, X);
|
||||
|
||||
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::list<int>::const_iterator >::type, int const);
|
||||
STATIC_ASSERT_SAME(boost::pointee<std::list<X>::const_iterator >::type, X const);
|
||||
return 0;
|
||||
|
@ -20,7 +20,7 @@ using boost::dummyT;
|
||||
// Test reverse iterator
|
||||
int main()
|
||||
{
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT array[] = { dummyT(0), dummyT(1), dummyT(2),
|
||||
dummyT(3), dummyT(4), dummyT(5) };
|
||||
const int N = sizeof(array)/sizeof(dummyT);
|
||||
|
||||
@ -104,29 +104,29 @@ int main()
|
||||
boost::function_requires< boost_concepts::BidirectionalTraversalConcept<Iter> >();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Test reverse_iterator
|
||||
{
|
||||
dummyT reversed[N];
|
||||
std::copy(array, array + N, reversed);
|
||||
std::reverse(reversed, reversed + N);
|
||||
|
||||
|
||||
typedef boost::reverse_iterator<dummyT*> reverse_iterator;
|
||||
|
||||
|
||||
reverse_iterator i(reversed + N);
|
||||
boost::random_access_iterator_test(i, N, array);
|
||||
|
||||
boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array);
|
||||
|
||||
typedef boost::reverse_iterator<const dummyT*> const_reverse_iterator;
|
||||
|
||||
|
||||
const_reverse_iterator j(reversed + N);
|
||||
boost::random_access_iterator_test(j, N, array);
|
||||
|
||||
const dummyT* const_reversed = reversed;
|
||||
|
||||
|
||||
boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array);
|
||||
|
||||
|
||||
boost::const_nonconst_iterator_test(i, ++j);
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ int main()
|
||||
// (e.g. "reversed + N") is used in the constructor below.
|
||||
const std::deque<dummyT>::iterator finish = reversed_container.end();
|
||||
reverse_iterator i(finish);
|
||||
|
||||
|
||||
boost::random_access_iterator_test(i, N, array);
|
||||
boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array);
|
||||
|
||||
@ -155,7 +155,7 @@ int main()
|
||||
|
||||
const std::deque<dummyT>::const_iterator const_reversed = reversed;
|
||||
boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array);
|
||||
|
||||
|
||||
// Many compilers' builtin deque iterators don't interoperate well, though
|
||||
// STLport fixes that problem.
|
||||
#if defined(__SGI_STL_PORT) \
|
||||
@ -164,9 +164,9 @@ int main()
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) \
|
||||
&& !BOOST_WORKAROUND(__LIBCOMO_VERSION__, BOOST_TESTED_AT(29)) \
|
||||
&& !BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 1)
|
||||
|
||||
|
||||
boost::const_nonconst_iterator_test(i, ++j);
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Copyright 2003 The Trustees of Indiana University.
|
||||
|
||||
// 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
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Shared container iterator adaptor
|
||||
// Shared container iterator adaptor
|
||||
// Author: Ronald Garcia
|
||||
// See http://boost.org/libs/utility/shared_container_iterator.html
|
||||
// for documentation.
|
||||
// See http://boost.org/libs/utility/shared_container_iterator.html
|
||||
// for documentation.
|
||||
|
||||
//
|
||||
// shared_iterator_test.cpp - Regression tests for shared_container_iterator.
|
||||
@ -38,7 +38,7 @@ void set_range(iterator& i, iterator& end) {
|
||||
|
||||
for (int j = 0; j != 6; ++j)
|
||||
objs->push_back(resource());
|
||||
|
||||
|
||||
i = iterator(objs->begin(),objs);
|
||||
end = iterator(objs->end(),objs);
|
||||
BOOST_TEST_EQ(resource::count, 6);
|
||||
@ -48,7 +48,7 @@ void set_range(iterator& i, iterator& end) {
|
||||
int main() {
|
||||
|
||||
BOOST_TEST_EQ(resource::count, 0);
|
||||
|
||||
|
||||
{
|
||||
iterator i;
|
||||
{
|
||||
@ -59,6 +59,6 @@ int main() {
|
||||
BOOST_TEST_EQ(resource::count, 6);
|
||||
}
|
||||
BOOST_TEST_EQ(resource::count, 0);
|
||||
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ struct mult_functor {
|
||||
int a;
|
||||
};
|
||||
|
||||
struct adaptable_mult_functor
|
||||
struct adaptable_mult_functor
|
||||
: mult_functor
|
||||
{
|
||||
typedef int result_type;
|
||||
@ -249,7 +249,7 @@ main()
|
||||
);
|
||||
|
||||
boost::constant_lvalue_iterator_test(
|
||||
boost::make_transform_iterator((pair_t*)values, const_select_first()), x[0]);
|
||||
boost::make_transform_iterator((pair_t*)values, const_select_first()), x[0]);
|
||||
|
||||
boost::non_const_lvalue_iterator_test(
|
||||
boost::make_transform_iterator((pair_t*)values, select_first()), x[0], 17);
|
||||
|
Loading…
x
Reference in New Issue
Block a user