From e01de59cdd60b2c0716153c08550320f9374d57d Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 12 Oct 2001 22:22:42 +0000 Subject: [PATCH] Made these actually compile [SVN r11378] --- counting_iterator_example.cpp | 3 ++- indirect_iterator_example.cpp | 6 ++++-- iterator_adaptor_examples.cpp | 5 ++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/counting_iterator_example.cpp b/counting_iterator_example.cpp index 9513c06..4841a3c 100644 --- a/counting_iterator_example.cpp +++ b/counting_iterator_example.cpp @@ -42,12 +42,13 @@ int main(int, char*[]) // Use indirect iterator to print out numbers by accessing // them through the array of pointers. +#ifndef BOOST_MSVC 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; - +#endif return 0; } diff --git a/indirect_iterator_example.cpp b/indirect_iterator_example.cpp index f8434c4..13c0210 100644 --- a/indirect_iterator_example.cpp +++ b/indirect_iterator_example.cpp @@ -33,8 +33,8 @@ int main(int, char*[]) char mutable_characters[N]; char* pointers_to_mutable_chars[N]; - for (int i = 0; i < N; ++i) - pointers_to_mutable_chars[i] = &mutable_characters[i]; + for (int j = 0; j < N; ++j) + pointers_to_mutable_chars[j] = &mutable_characters[j]; PairGen::iterator mutable_indirect_first(pointers_to_mutable_chars), mutable_indirect_last(pointers_to_mutable_chars + N); @@ -51,10 +51,12 @@ int main(int, char*[]) // Example of using make_indirect_iterator() +#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, ",")); std::cout << std::endl; +#endif return 0; } diff --git a/iterator_adaptor_examples.cpp b/iterator_adaptor_examples.cpp index c7baa08..917fd02 100644 --- a/iterator_adaptor_examples.cpp +++ b/iterator_adaptor_examples.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include int @@ -21,8 +21,7 @@ main(int, char*[]) int x[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; typedef std::binder1st< std::multiplies > Function; - typedef boost::transform_iterator + typedef boost::transform_iterator_generator::type doubling_iterator; doubling_iterator i(x, std::bind1st(std::multiplies(), 2)),