From 399122589674391d8f513660f1c8efe182a01056 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Thu, 28 Aug 2014 20:00:26 +0200 Subject: [PATCH] fix issue related to ADL for begin()/end() --- example/cpp11/asymmetric/layout.cpp | 2 +- example/cpp11/asymmetric/same_fringe.cpp | 24 ++++++++--------- .../boost/coroutine/asymmetric_coroutine.hpp | 26 ------------------- 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/example/cpp11/asymmetric/layout.cpp b/example/cpp11/asymmetric/layout.cpp index 36768ae..e1e0f3c 100644 --- a/example/cpp11/asymmetric/layout.cpp +++ b/example/cpp11/asymmetric/layout.cpp @@ -44,7 +44,7 @@ int main(int argc,char* argv[]){ } }); - std::copy(std::begin(words),std::end(words),std::begin(writer)); + std::copy(std::begin(words),std::end(words),boost::begin(writer)); return 0; } diff --git a/example/cpp11/asymmetric/same_fringe.cpp b/example/cpp11/asymmetric/same_fringe.cpp index 9bc646f..dec44ad 100644 --- a/example/cpp11/asymmetric/same_fringe.cpp +++ b/example/cpp11/asymmetric/same_fringe.cpp @@ -100,8 +100,8 @@ int main() traverse(left_d,out); }); std::cout << "left tree from d:\n"; - std::copy(std::begin(left_d_reader), - std::end(left_d_reader), + std::copy(boost::begin(left_d_reader), + boost::end(left_d_reader), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; @@ -111,8 +111,8 @@ int main() traverse(right_b,out); }); std::cout << "right tree from b:\n"; - std::copy(std::begin(right_b_reader), - std::end(right_b_reader), + std::copy(boost::begin(right_b_reader), + boost::end(right_b_reader), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; @@ -122,8 +122,8 @@ int main() traverse(right_x,out); }); std::cout << "right tree from x:\n"; - std::copy(std::begin(right_x_reader), - std::end(right_x_reader), + std::copy(boost::begin(right_x_reader), + boost::end(right_x_reader), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; } @@ -143,9 +143,9 @@ int main() std::cout << "left tree from d == right tree from b? " << std::boolalpha - << std::equal(std::begin(left_d_reader), - std::end(left_d_reader), - std::begin(right_b_reader)) + << std::equal(boost::begin(left_d_reader), + boost::end(left_d_reader), + boost::begin(right_b_reader)) << std::endl; } @@ -164,9 +164,9 @@ int main() std::cout << "left tree from d == right tree from x? " << std::boolalpha - << std::equal(std::begin(left_d_reader), - std::end(left_d_reader), - std::begin(right_x_reader)) + << std::equal(boost::begin(left_d_reader), + boost::end(left_d_reader), + boost::begin(right_x_reader)) << std::endl; } diff --git a/include/boost/coroutine/asymmetric_coroutine.hpp b/include/boost/coroutine/asymmetric_coroutine.hpp index aada349..ff4684f 100644 --- a/include/boost/coroutine/asymmetric_coroutine.hpp +++ b/include/boost/coroutine/asymmetric_coroutine.hpp @@ -2204,7 +2204,6 @@ struct coroutine typedef pull_coroutine< T > pull_type; }; -#if defined(__clang__) template< typename R > typename pull_coroutine< R >::iterator begin( pull_coroutine< R > & c) @@ -2224,7 +2223,6 @@ template< typename R > typename push_coroutine< R >::iterator end( push_coroutine< R > & c) { return boost::end( c); } -#endif } @@ -2238,30 +2236,6 @@ struct range_mutable_iterator< coroutines::pull_coroutine< R > > } -namespace std { - -template< typename R > -typename boost::coroutines::pull_coroutine< R >::iterator -begin( boost::coroutines::pull_coroutine< R > & c) -{ return boost::begin( c); } - -template< typename R > -typename boost::coroutines::pull_coroutine< R >::iterator -end( boost::coroutines::pull_coroutine< R > & c) -{ return boost::end( c); } - -template< typename R > -typename boost::coroutines::push_coroutine< R >::iterator -begin( boost::coroutines::push_coroutine< R > & c) -{ return boost::begin( c); } - -template< typename R > -typename boost::coroutines::push_coroutine< R >::iterator -end( boost::coroutines::push_coroutine< R > & c) -{ return boost::end( c); } - -} - #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif