From d7c8cccd64ab5d8009e8c653b5a878e325d6abcb Mon Sep 17 00:00:00 2001 From: drgler Date: Tue, 14 Mar 2017 20:45:48 +0100 Subject: [PATCH 1/3] Bug fix for ticket #12895: Apply remove_reference before remove_cv --- include/boost/iterator/zip_iterator.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/iterator/zip_iterator.hpp b/include/boost/iterator/zip_iterator.hpp index 61d1f17..f5780ae 100644 --- a/include/boost/iterator/zip_iterator.hpp +++ b/include/boost/iterator/zip_iterator.hpp @@ -83,7 +83,7 @@ namespace iterators { struct result { typedef typename - remove_reference::type>::type + remove_cv::type>::type iterator; typedef typename iterator_reference::type type; From ca3b7505ceac4c7202eb42f2fbe3968a41cd1eb9 Mon Sep 17 00:00:00 2001 From: morinmorin Date: Wed, 15 Mar 2017 20:41:24 +0900 Subject: [PATCH 2/3] Add a testcase for trac ticket 12895 --- test/detail/zip_iterator_test.ipp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/detail/zip_iterator_test.ipp b/test/detail/zip_iterator_test.ipp index f659099..437cc49 100644 --- a/test/detail/zip_iterator_test.ipp +++ b/test/detail/zip_iterator_test.ipp @@ -58,6 +58,18 @@ int main() BOOST_TEST(boost::fusion::at_c<1>(*(i + 1)) == "pyonpyon"); } + { + // Trac #12895 + boost::zip_iterator< + TUPLE + > i(MAKE_TUPLE(vi.data(), vs.data())); + + BOOST_TEST(boost::fusion::at_c<0>(* i ) == 42); + BOOST_TEST(boost::fusion::at_c<1>(* i ) == "kokoro"); + BOOST_TEST(boost::fusion::at_c<0>(*(i + 1)) == 72); + BOOST_TEST(boost::fusion::at_c<1>(*(i + 1)) == "pyonpyon"); + } + { boost::zip_iterator i1(MAKE_TUPLE(vi.begin(), vs.begin())); boost::zip_iterator i2(MAKE_TUPLE(vi.end(), vs.end())); From cccbd8c6aa8bbb1cd3552ecfb96494a086a4aaac Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Sat, 8 Apr 2017 16:53:02 -0400 Subject: [PATCH 3/3] Test needs both std::typle support and variadic template support. --- test/zip_iterator_test2_std_tuple.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/zip_iterator_test2_std_tuple.cpp b/test/zip_iterator_test2_std_tuple.cpp index 60b1b97..95eff87 100644 --- a/test/zip_iterator_test2_std_tuple.cpp +++ b/test/zip_iterator_test2_std_tuple.cpp @@ -1,6 +1,6 @@ #include -#if !defined(BOOST_NO_CXX11_HDR_TUPLE) +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #include #include