diff --git a/example/counting_iterator_example.cpp b/example/counting_iterator_example.cpp index c7d8add..de45487 100644 --- a/example/counting_iterator_example.cpp +++ b/example/counting_iterator_example.cpp @@ -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(std::cout, " ")); std::cout << std::endl; - + return boost::exit_success; } diff --git a/example/filter_iterator_example.cpp b/example/filter_iterator_example.cpp index 610c29b..b427dea 100644 --- a/example/filter_iterator_example.cpp +++ b/example/filter_iterator_example.cpp @@ -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(numbers, numbers + N), boost::make_filter_iterator(numbers + N, numbers + N), @@ -32,7 +32,7 @@ int main() // Example using filter_iterator typedef boost::filter_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(), boost::placeholders::_1, -2) , numbers, numbers + N) - + , boost::make_filter_iterator( boost::bind(std::greater(), boost::placeholders::_1, -2) , numbers + N, numbers + N) - + , std::ostream_iterator(std::cout, " ") ); - + std::cout << std::endl; - + return boost::exit_success; } diff --git a/example/func_output_iter_example.cpp b/example/func_output_iter_example.cpp index 9c06319..8a76b7f 100644 --- a/example/func_output_iter_example.cpp +++ b/example/func_output_iter_example.cpp @@ -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; diff --git a/example/indirect_iterator_example.cpp b/example/indirect_iterator_example.cpp index 478f9bc..74de317 100644 --- a/example/indirect_iterator_example.cpp +++ b/example/indirect_iterator_example.cpp @@ -21,13 +21,13 @@ int main(int, char*[]) pointers_to_chars[i] = &characters[i]; // Example of using indirect_iterator - + boost::indirect_iterator indirect_first(pointers_to_chars), indirect_last(pointers_to_chars + N); std::copy(indirect_first, indirect_last, std::ostream_iterator(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(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(std::cout, ",")); std::cout << std::endl; - + return 0; } diff --git a/example/node_iterator1.cpp b/example/node_iterator1.cpp index 94b34e8..722a28f 100644 --- a/example/node_iterator1.cpp +++ b/example/node_iterator1.cpp @@ -15,11 +15,11 @@ int main() #if defined(BOOST_NO_CXX11_SMART_PTR) std::auto_ptr > nodes(new node(42)); - + #else std::unique_ptr > nodes(new node(42)); - + #endif nodes->append(new node(" is greater than ")); @@ -30,7 +30,7 @@ int main() , std::ostream_iterator(std::cout, " ") ); std::cout << std::endl; - + std::for_each( node_iterator(nodes.get()), node_iterator() , std::mem_fun_ref(&node_base::double_me) diff --git a/example/node_iterator2.cpp b/example/node_iterator2.cpp index f8f873e..5ab71b6 100644 --- a/example/node_iterator2.cpp +++ b/example/node_iterator2.cpp @@ -16,11 +16,11 @@ int main() #if defined(BOOST_NO_CXX11_SMART_PTR) std::auto_ptr > nodes(new node(42)); - + #else std::unique_ptr > nodes(new node(42)); - + #endif nodes->append(new node(" 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(std::cout, " ") ); std::cout << std::endl; - + std::for_each( node_iterator(nodes.get()), node_iterator() , boost::mem_fn(&node_base::double_me) diff --git a/example/node_iterator3.cpp b/example/node_iterator3.cpp index 7cb4238..551f218 100644 --- a/example/node_iterator3.cpp +++ b/example/node_iterator3.cpp @@ -16,11 +16,11 @@ int main() #if defined(BOOST_NO_CXX11_SMART_PTR) std::auto_ptr > nodes(new node(42)); - + #else std::unique_ptr > nodes(new node(42)); - + #endif nodes->append(new node(" 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(std::cout, " ") ); std::cout << std::endl; - + std::for_each( node_iterator(nodes.get()), node_iterator() , boost::mem_fn(&node_base::double_me) diff --git a/example/permutation_iter_example.cpp b/example/permutation_iter_example.cpp index aad6125..5089d64 100644 --- a/example/permutation_iter_example.cpp +++ b/example/permutation_iter_example.cpp @@ -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() ); diff --git a/example/reverse_iterator_example.cpp b/example/reverse_iterator_example.cpp index 61b8c4f..0baa0ff 100644 --- a/example/reverse_iterator_example.cpp +++ b/example/reverse_iterator_example.cpp @@ -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 reverse_letters_first(letters + N), reverse_letters_last(letters); diff --git a/example/shared_iterator_example1.cpp b/example/shared_iterator_example1.cpp index f88e094..0ca6119 100644 --- a/example/shared_iterator_example1.cpp +++ b/example/shared_iterator_example1.cpp @@ -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 > iterator; void set_range(iterator& i, iterator& end) { boost::shared_ptr< std::vector > ints(new std::vector()); - + 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); } diff --git a/example/shared_iterator_example2.cpp b/example/shared_iterator_example2.cpp index a957707..e8b0dc6 100644 --- a/example/shared_iterator_example2.cpp +++ b/example/shared_iterator_example2.cpp @@ -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; diff --git a/example/shared_iterator_example3.cpp b/example/shared_iterator_example3.cpp index 5615d45..971b01f 100644 --- a/example/shared_iterator_example3.cpp +++ b/example/shared_iterator_example3.cpp @@ -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 // for std::copy -#include +#include #include @@ -31,7 +31,7 @@ int main() { iterator i,end; - + boost::tie(i,end) = return_range(); std::copy(i,end,std::ostream_iterator(std::cout,",")); diff --git a/example/transform_iterator_example.cpp b/example/transform_iterator_example.cpp index ce1b413..a684ebf 100644 --- a/example/transform_iterator_example.cpp +++ b/example/transform_iterator_example.cpp @@ -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 + template 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(), 4)), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; - + return 0; } diff --git a/test/concept_tests.cpp b/test/concept_tests.cpp index 5fb6a78..091f6e5 100644 --- a/test/concept_tests.cpp +++ b/test/concept_tests.cpp @@ -71,7 +71,7 @@ main() boost::iterator_traversal::type tc; boost::random_access_traversal_tag derived = tc; (void)derived; - + boost::function_requires< boost_concepts::WritableIteratorConcept >(); boost::function_requires< diff --git a/test/counting_iterator_test.cpp b/test/counting_iterator_test.cpp index 59caa0d..899b045 100644 --- a/test/counting_iterator_test.cpp +++ b/test/counting_iterator_test.cpp @@ -42,7 +42,7 @@ #include #ifndef __BORLANDC__ # include -#endif +#endif #include #include #include @@ -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::test(offset); #endif - + CountingIterator internal = start; std::advance(internal, offset); @@ -111,7 +111,7 @@ void category_test( std::pair 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 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(); test_integer(); test_integer(); - + // Some tests on container iterators, to prove we handle a few different categories test_container >(); test_container >(); # ifndef BOOST_NO_SLIST test_container >(); # 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)); diff --git a/test/filter_iterator_test.cpp b/test/filter_iterator_test.cpp index beaab4d..cf850bc 100644 --- a/test/filter_iterator_test.cpp +++ b/test/filter_iterator_test.cpp @@ -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 using boost::dummyT; - + struct one_or_four { bool operator()(dummyT x) const @@ -116,7 +116,7 @@ int main() boost::function_requires< boost_concepts::WritableIteratorConcept >(); boost::function_requires< boost_concepts::SinglePassIteratorConcept >(); } -#endif +#endif { typedef boost::iterator_archetype< const dummyT @@ -128,7 +128,7 @@ int main() boost::function_requires< boost_concepts::ReadableIteratorConcept >(); boost::function_requires< boost_concepts::ForwardTraversalConcept >(); } - + #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 >(); boost::function_requires< boost_concepts::ForwardTraversalConcept >(); } -#endif +#endif { typedef boost::iterator_archetype< @@ -178,7 +178,7 @@ int main() boost::function_requires< boost_concepts::ReadableIteratorConcept >(); boost::function_requires< boost_concepts::BidirectionalTraversalConcept >(); } - + #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 >(); boost::function_requires< boost_concepts::BidirectionalTraversalConcept >(); } -#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)); diff --git a/test/function_input_iterator_test.cpp b/test/function_input_iterator_test.cpp index a4221ee..4843f01 100644 --- a/test/function_input_iterator_test.cpp +++ b/test/function_input_iterator_test.cpp @@ -55,7 +55,7 @@ int main() ones ones_generator; vector values(10); generate(values.begin(), values.end(), ones()); - + vector generated; copy( boost::make_function_input_iterator(ones_generator, 0), diff --git a/test/indirect_iter_member_types.cpp b/test/indirect_iter_member_types.cpp index da09ac8..240e664 100644 --- a/test/indirect_iter_member_types.cpp +++ b/test/indirect_iter_member_types.cpp @@ -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 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::value)); BOOST_STATIC_ASSERT((boost::is_convertible::type, @@ -54,13 +54,13 @@ int main() { typedef boost::indirect_iterator 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 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::value)); BOOST_STATIC_ASSERT((boost::is_convertible::type, @@ -79,9 +79,9 @@ int main() { typedef boost::indirect_iterator 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; } diff --git a/test/indirect_iterator_test.cpp b/test/indirect_iterator_test.cpp index 02c2914..a08afa8 100644 --- a/test/indirect_iterator_test.cpp +++ b/test/indirect_iterator_test.cpp @@ -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); diff --git a/test/is_lvalue_iterator.cpp b/test/is_lvalue_iterator.cpp index 3871032..ba880d7 100644 --- a/test/is_lvalue_iterator.cpp +++ b/test/is_lvalue_iterator.cpp @@ -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 >::value); BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - + BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - - + + BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator::value); BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator::value); BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator::iterator>::value); @@ -131,18 +131,18 @@ int main() BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator::value); #endif BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator::value); - + BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); -#endif +#endif BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); - + BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); - + return 0; } diff --git a/test/is_readable_iterator.cpp b/test/is_readable_iterator.cpp index c663697..1d33a64 100644 --- a/test/is_readable_iterator.cpp +++ b/test/is_readable_iterator.cpp @@ -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::value); BOOST_STATIC_ASSERT(!boost::is_readable_iterator::value); BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); - + // Make sure inaccessible copy constructor doesn't prevent // readability BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); - + return 0; } diff --git a/test/iterator_adaptor_cc.cpp b/test/iterator_adaptor_cc.cpp index 599474c..1ab676a 100644 --- a/test/iterator_adaptor_cc.cpp +++ b/test/iterator_adaptor_cc.cpp @@ -41,6 +41,6 @@ int main() boost::function_requires< boost_concepts::InteroperableIteratorConcept >(); } #endif - + return boost::exit_success; } diff --git a/test/iterator_adaptor_test.cpp b/test/iterator_adaptor_test.cpp index 5b99891..88a8a1b 100644 --- a/test/iterator_adaptor_test.cpp +++ b/test/iterator_adaptor_test.cpp @@ -16,7 +16,7 @@ #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) # include # include -#endif +#endif #include # include @@ -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 struct fwd_iterator : boost::iterator_adaptor< @@ -108,7 +108,7 @@ private: fwd_iterator , boost::forward_iterator_archetype > super_t; - + public: fwd_iterator() { } fwd_iterator(boost::forward_iterator_archetype d) : super_t(d) { } @@ -126,7 +126,7 @@ private: in_iterator , boost::input_iterator_archetype_no_proxy > super_t; - + public: in_iterator() { } in_iterator(boost::input_iterator_archetype_no_proxy d) : super_t(d) { } @@ -145,7 +145,7 @@ struct constant_iterator , Iter , typename std::iterator_traits::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 i(array); boost::random_access_iterator_test(i, N, array); - + ptr_iterator 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::value; #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) BOOST_STATIC_ASSERT((boost::is_convertible::value)); -#endif +#endif } - - { + + { // Test computation of default when the Value is const typedef ptr_iterator Iter1; test = static_assert_same::value; test = static_assert_same::value; - + #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); # ifndef BOOST_NO_LVALUE_RETURN_DETECTION BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::value); -# endif +# endif #endif #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // borland drops constness test = static_assert_same::value; -#endif +#endif } { @@ -240,24 +240,24 @@ main() test = static_assert_same::value; #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // borland drops constness test = static_assert_same::value; -#endif +#endif #ifndef BOOST_NO_LVALUE_RETURN_DETECTION BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator::value); BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::value); -#endif - +#endif + typedef modify_traversal IncrementableIter; static_assert_traversal(); static_assert_traversal(); } - + // Test the iterator_adaptor { ptr_iterator i(array); boost::random_access_iterator_test(i, N, array); - + ptr_iterator 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 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 diff --git a/test/iterator_archetype_cc.cpp b/test/iterator_archetype_cc.cpp index 580a32c..98d32ae 100644 --- a/test/iterator_archetype_cc.cpp +++ b/test/iterator_archetype_cc.cpp @@ -21,7 +21,7 @@ int main() boost::function_requires< boost_concepts::ReadableIteratorConcept >(); boost::function_requires< boost_concepts::RandomAccessTraversalConcept >(); - } + } { typedef boost::iterator_archetype< int @@ -32,7 +32,7 @@ int main() boost::function_requires< boost_concepts::ReadableIteratorConcept >(); boost::function_requires< boost_concepts::WritableIteratorConcept >(); boost::function_requires< boost_concepts::RandomAccessTraversalConcept >(); - } + } { 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 >(); boost::function_requires< boost_concepts::LvalueIteratorConcept >(); boost::function_requires< boost_concepts::RandomAccessTraversalConcept >(); - } + } { typedef boost::iterator_archetype< int @@ -54,7 +54,7 @@ int main() boost::function_requires< boost_concepts::WritableIteratorConcept >(); boost::function_requires< boost_concepts::LvalueIteratorConcept >(); boost::function_requires< boost_concepts::RandomAccessTraversalConcept >(); - } + } return boost::exit_success; } diff --git a/test/iterator_traits_test.cpp b/test/iterator_traits_test.cpp index 1aa46d6..4dd4e7a 100644 --- a/test/iterator_traits_test.cpp +++ b/test/iterator_traits_test.cpp @@ -40,7 +40,7 @@ struct my_iterator1 : boost::forward_iterator_helper { 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 my_iterator1_test; - + non_pointer_test my_iterator2_test; @@ -205,7 +205,7 @@ int main() { std::list l(length); BOOST_TEST(boost::detail::distance(l.begin(), l.end()) == length); - + std::vector v(length); BOOST_TEST(boost::detail::distance(v.begin(), v.end()) == length); diff --git a/test/permutation_iterator_test.cpp b/test/permutation_iterator_test.cpp index 6d14218..6fbeaad 100644 --- a/test/permutation_iterator_test.cpp +++ b/test/permutation_iterator_test.cpp @@ -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 ); diff --git a/test/pointee.cpp b/test/pointee.cpp index 3b99947..32e3496 100644 --- a/test/pointee.cpp +++ b/test/pointee.cpp @@ -35,7 +35,7 @@ struct X { template operator T&() const; }; - + int main() { STATIC_ASSERT_SAME(boost::pointee >::type, int); @@ -43,16 +43,16 @@ int main() STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); - + STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); - + STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); STATIC_ASSERT_SAME(boost::pointee::type, int); STATIC_ASSERT_SAME(boost::pointee::type, int const); - + STATIC_ASSERT_SAME(boost::pointee::type, X); STATIC_ASSERT_SAME(boost::pointee::type, X const); @@ -60,7 +60,7 @@ int main() STATIC_ASSERT_SAME(boost::pointee >::type, int); STATIC_ASSERT_SAME(boost::pointee >::type, X); - + STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); @@ -68,7 +68,7 @@ int main() STATIC_ASSERT_SAME(boost::pointee >::type, int); STATIC_ASSERT_SAME(boost::pointee >::type, X); - + STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); @@ -76,7 +76,7 @@ int main() STATIC_ASSERT_SAME(boost::pointee::iterator >::type, int); STATIC_ASSERT_SAME(boost::pointee::iterator >::type, X); - + STATIC_ASSERT_SAME(boost::pointee::const_iterator >::type, int const); STATIC_ASSERT_SAME(boost::pointee::const_iterator >::type, X const); return 0; diff --git a/test/reverse_iterator_test.cpp b/test/reverse_iterator_test.cpp index 828bdfe..8ac5e10 100644 --- a/test/reverse_iterator_test.cpp +++ b/test/reverse_iterator_test.cpp @@ -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 >(); } #endif - + // Test reverse_iterator { dummyT reversed[N]; std::copy(array, array + N, reversed); std::reverse(reversed, reversed + N); - + typedef boost::reverse_iterator 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_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::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::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 } diff --git a/test/shared_iterator_test.cpp b/test/shared_iterator_test.cpp index 27e007a..a943d30 100644 --- a/test/shared_iterator_test.cpp +++ b/test/shared_iterator_test.cpp @@ -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(); } diff --git a/test/transform_iterator_test.cpp b/test/transform_iterator_test.cpp index 7a77b2c..b22cb16 100644 --- a/test/transform_iterator_test.cpp +++ b/test/transform_iterator_test.cpp @@ -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);