diff --git a/counting_iterator_example.cpp b/counting_iterator_example.cpp index 8174b2f..3817069 100644 --- a/counting_iterator_example.cpp +++ b/counting_iterator_example.cpp @@ -22,8 +22,8 @@ int main(int, char*[]) // Example of using make_counting_iterator() std::cout << "counting from -5 to 4:" << std::endl; std::copy(boost::make_counting_iterator(-5), - boost::make_counting_iterator(5), - std::ostream_iterator(std::cout, " ")); + boost::make_counting_iterator(5), + std::ostream_iterator(std::cout, " ")); std::cout << std::endl; // Example of using counting iterator to create an array of pointers. @@ -31,7 +31,7 @@ int main(int, char*[]) std::vector numbers; // Fill "numbers" array with [0,N) std::copy(boost::make_counting_iterator(0), boost::make_counting_iterator(N), - std::back_inserter(numbers)); + std::back_inserter(numbers)); std::vector::iterator> pointers; @@ -39,16 +39,16 @@ int main(int, char*[]) #if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200) // Use counting iterator to fill in the array of pointers. std::copy(boost::make_counting_iterator(numbers.begin()), - boost::make_counting_iterator(numbers.end()), - std::back_inserter(pointers)); + boost::make_counting_iterator(numbers.end()), + std::back_inserter(pointers)); // 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 " - << N << std::endl; + << N << std::endl; std::copy(boost::make_indirect_iterator(pointers.begin()), - boost::make_indirect_iterator(pointers.end()), - std::ostream_iterator(std::cout, " ")); + boost::make_indirect_iterator(pointers.end()), + std::ostream_iterator(std::cout, " ")); std::cout << std::endl; #endif return 0; diff --git a/filter_iterator_example.cpp b/filter_iterator_example.cpp index f74f2e3..bcec35d 100644 --- a/filter_iterator_example.cpp +++ b/filter_iterator_example.cpp @@ -33,8 +33,8 @@ int main() // Example using make_filter_iterator() std::copy(boost::make_filter_iterator(numbers, numbers + N), - boost::make_filter_iterator(numbers + N, numbers + N), - std::ostream_iterator(std::cout, " ")); + boost::make_filter_iterator(numbers + N, numbers + N), + std::ostream_iterator(std::cout, " ")); std::cout << std::endl; // Example using filter_iterator_generator @@ -50,10 +50,10 @@ int main() // Another example using make_filter_iterator() std::copy(boost::make_filter_iterator(numbers, numbers + N, - std::bind2nd(std::greater(), -2)), - boost::make_filter_iterator(numbers + N, numbers + N, - std::bind2nd(std::greater(), -2)), - std::ostream_iterator(std::cout, " ")); + std::bind2nd(std::greater(), -2)), + boost::make_filter_iterator(numbers + N, numbers + N, + std::bind2nd(std::greater(), -2)), + std::ostream_iterator(std::cout, " ")); std::cout << std::endl; diff --git a/indirect_iterator_example.cpp b/indirect_iterator_example.cpp index 13c0210..fb2b608 100644 --- a/indirect_iterator_example.cpp +++ b/indirect_iterator_example.cpp @@ -42,10 +42,10 @@ int main(int, char*[]) const_indirect_last(pointers_to_chars + N); std::transform(const_indirect_first, const_indirect_last, - mutable_indirect_first, std::bind1st(std::plus(), 1)); + mutable_indirect_first, std::bind1st(std::plus(), 1)); std::copy(mutable_indirect_first, mutable_indirect_last, - std::ostream_iterator(std::cout, ",")); + std::ostream_iterator(std::cout, ",")); std::cout << std::endl; @@ -53,8 +53,8 @@ int main(int, char*[]) #ifndef BOOST_MSVC std::copy(boost::make_indirect_iterator(pointers_to_chars), - boost::make_indirect_iterator(pointers_to_chars + N), - std::ostream_iterator(std::cout, ",")); + boost::make_indirect_iterator(pointers_to_chars + N), + std::ostream_iterator(std::cout, ",")); std::cout << std::endl; #endif diff --git a/iter_traits_gen_test.cpp b/iter_traits_gen_test.cpp index 9198142..ca214d4 100644 --- a/iter_traits_gen_test.cpp +++ b/iter_traits_gen_test.cpp @@ -21,7 +21,7 @@ main() { using boost::dummyT; dummyT array[] = { dummyT(0), dummyT(1), dummyT(2), - dummyT(3), dummyT(4), dummyT(5) }; + dummyT(3), dummyT(4), dummyT(5) }; typedef boost::iterator_adaptor my_iter; my_iter mi(array); diff --git a/iterator_adaptor_test.cpp b/iterator_adaptor_test.cpp index 5f4aa20..74eca35 100644 --- a/iterator_adaptor_test.cpp +++ b/iterator_adaptor_test.cpp @@ -309,8 +309,8 @@ main() // Borland is choking on accessing the policies_type explicitly // from the filter_iter. boost::forward_iterator_test(make_filter_iterator(array, array+N, - one_or_four()), - dummyT(1), dummyT(4)); + one_or_four()), + dummyT(1), dummyT(4)); #else filter_iter i(array, filter_iter::policies_type(one_or_four(), array + N)); boost::forward_iterator_test(i, dummyT(1), dummyT(4)); diff --git a/reverse_iterator_example.cpp b/reverse_iterator_example.cpp index b244855..f80bd1b 100644 --- a/reverse_iterator_example.cpp +++ b/reverse_iterator_example.cpp @@ -22,7 +22,7 @@ int main(int, char*[]) base_iterator letters(letters_); std::cout << "original sequence of letters:\t" - << letters_ << std::endl; + << letters_ << std::endl; std::sort(letters, letters + N); @@ -35,7 +35,7 @@ int main(int, char*[]) std::cout << "letters in descending order:\t"; std::copy(reverse_letters_first, reverse_letters_last, - std::ostream_iterator(std::cout)); + std::ostream_iterator(std::cout)); std::cout << std::endl; // Use make_reverse_iterator() to print the sequence @@ -43,8 +43,8 @@ int main(int, char*[]) std::cout << "letters in ascending order:\t"; std::copy(boost::make_reverse_iterator(reverse_letters_last), - boost::make_reverse_iterator(reverse_letters_first), - std::ostream_iterator(std::cout)); + boost::make_reverse_iterator(reverse_letters_first), + std::ostream_iterator(std::cout)); std::cout << std::endl; return 0; diff --git a/tie_example.cpp b/tie_example.cpp index 1fb12b6..206f61e 100644 --- a/tie_example.cpp +++ b/tie_example.cpp @@ -41,9 +41,9 @@ main(int, char*[]) for (int k = 0; k < 2; ++k) { boost::tie(i,inserted) = s.insert(new_vals[k]); if (!inserted) - std::cout << *i << " was already in the set." << std::endl; + std::cout << *i << " was already in the set." << std::endl; else - std::cout << *i << " successfully inserted." << std::endl; + std::cout << *i << " successfully inserted." << std::endl; } } { @@ -55,7 +55,7 @@ main(int, char*[]) boost::tie(i,end) = std::equal_range(vals, vals + 6, 4); std::cout << "There were " << std::distance(i,end) - << " occurrences of " << *i << "." << std::endl; + << " occurrences of " << *i << "." << std::endl; // Footnote: of course one would normally just use std::count() // to get this information, but that would spoil the example :) } diff --git a/transform_iterator_example.cpp b/transform_iterator_example.cpp index 9ada36c..f65a493 100644 --- a/transform_iterator_example.cpp +++ b/transform_iterator_example.cpp @@ -18,15 +18,15 @@ namespace boost { template class binder1st : public std::unary_function { + typename Operation::result_type> { protected: Operation op; typename Operation::first_argument_type value; public: binder1st() { } // this had to be added! binder1st(const Operation& x, - const typename Operation::first_argument_type& y) - : op(x), value(y) {} + const typename Operation::first_argument_type& y) + : op(x), value(y) {} typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const { return op(value, x); @@ -66,8 +66,8 @@ main(int, char*[]) std::cout << "adding 4 to each element in the array:" << std::endl; std::copy(boost::make_transform_iterator(x, boost::bind1st(std::plus(), 4)), - boost::make_transform_iterator(x + N, boost::bind1st(std::plus(), 4)), - std::ostream_iterator(std::cout, " ")); + boost::make_transform_iterator(x + N, boost::bind1st(std::plus(), 4)), + std::ostream_iterator(std::cout, " ")); std::cout << std::endl; return 0;