From 414840de42fde9640fb3365224dd77100b83f3bb Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Wed, 16 Apr 2008 05:50:41 +0000 Subject: [PATCH] Merged revisions 44427,44431-44439,44441-44446,44448-44450 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r44427 | schoepflin | 2008-04-15 00:58:48 -0700 (Tue, 15 Apr 2008) | 1 line The thread start routine needs C linkage. This fixes a compilation error on Tru64/cxx. ........ r44431 | johnmaddock | 2008-04-15 09:32:28 -0700 (Tue, 15 Apr 2008) | 1 line Fix IBM AIX compiler errors. ........ r44432 | johnmaddock | 2008-04-15 09:36:21 -0700 (Tue, 15 Apr 2008) | 1 line Attempt fix for Intel on Darwin failures. ........ r44433 | johnmaddock | 2008-04-15 10:10:18 -0700 (Tue, 15 Apr 2008) | 2 lines Fix error rates on Mac OS X. Fix long double support for pow_test.cpp. ........ r44434 | johnmaddock | 2008-04-15 10:30:03 -0700 (Tue, 15 Apr 2008) | 1 line Add some explicit casts from the FP_* macros to type int, so that comparisons actually work when building with GCC, this is GCC bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20589. ........ r44435 | johnmaddock | 2008-04-15 10:35:07 -0700 (Tue, 15 Apr 2008) | 1 line Try and fix one remaining zeta test failure. ........ r44436 | jurko | 2008-04-15 10:44:31 -0700 (Tue, 15 Apr 2008) | 1 line Minor stylistic comment changes. ........ r44437 | johnmaddock | 2008-04-15 10:50:11 -0700 (Tue, 15 Apr 2008) | 1 line Add explicit type cast to fix GCC-C++0X mode error. ........ r44438 | emildotchevski | 2008-04-15 11:24:46 -0700 (Tue, 15 Apr 2008) | 1 line N2179 compliance (pending documentation update) ........ r44439 | emildotchevski | 2008-04-15 11:47:16 -0700 (Tue, 15 Apr 2008) | 1 line introduced boost/exception_ptr.hpp, using Boost Exception ........ r44441 | pdimov | 2008-04-15 12:02:13 -0700 (Tue, 15 Apr 2008) | 1 line Disabled sync use for hppa. ........ r44442 | emildotchevski | 2008-04-15 14:13:24 -0700 (Tue, 15 Apr 2008) | 1 line Boost Exception header compilation tests added. ........ r44443 | emildotchevski | 2008-04-15 14:14:23 -0700 (Tue, 15 Apr 2008) | 1 line Boost Exception documentation source ........ r44444 | emildotchevski | 2008-04-15 14:56:34 -0700 (Tue, 15 Apr 2008) | 1 line Boost Exception documentation update ........ r44445 | emildotchevski | 2008-04-15 15:23:19 -0700 (Tue, 15 Apr 2008) | 1 line Boost Exception documentation fix ........ r44446 | emildotchevski | 2008-04-15 15:25:11 -0700 (Tue, 15 Apr 2008) | 2 lines Boost Exception documentation fix ........ r44448 | fmhess | 2008-04-15 17:06:29 -0700 (Tue, 15 Apr 2008) | 5 lines Avoid needless overhead of wrapping owner's deleter in deleter_wrapper if shared_from_this has not been called yet, as Peter suggested earlier. ........ r44449 | djowel | 2008-04-15 20:07:06 -0700 (Tue, 15 Apr 2008) | 1 line Andreas patch ........ r44450 | djowel | 2008-04-15 20:07:11 -0700 (Tue, 15 Apr 2008) | 1 line Andreas indexing suite patch ........ [SVN r44451] --- .../boost/python/suite/indexing/container_utils.hpp | 13 +++++++++---- test/vector_indexing_suite.py | 13 +++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/boost/python/suite/indexing/container_utils.hpp b/include/boost/python/suite/indexing/container_utils.hpp index a25185d0..72710bb8 100644 --- a/include/boost/python/suite/indexing/container_utils.hpp +++ b/include/boost/python/suite/indexing/container_utils.hpp @@ -7,9 +7,12 @@ #ifndef PY_CONTAINER_UTILS_JDG20038_HPP # define PY_CONTAINER_UTILS_JDG20038_HPP +# include +# include # include # include # include +# include namespace boost { namespace python { namespace container_utils { @@ -19,11 +22,13 @@ namespace boost { namespace python { namespace container_utils { { typedef typename Container::value_type data_type; - // l must be a list or some container - - for (int i = 0; i < l.attr("__len__")(); i++) + // l must be iterable + BOOST_FOREACH(object elem, + std::make_pair( + boost::python::stl_input_iterator(l), + boost::python::stl_input_iterator() + )) { - object elem(l[i]); extract x(elem); // try if elem is an exact data_type type if (x.check()) diff --git a/test/vector_indexing_suite.py b/test/vector_indexing_suite.py index 9bb75700..5fe2efe4 100644 --- a/test/vector_indexing_suite.py +++ b/test/vector_indexing_suite.py @@ -321,6 +321,19 @@ e >>> print_xvec(v) [ a b c d e f g h i j ] +##################################################################### +# extend using a generator expression +##################################################################### +>>> v[:] = ['a','b','c','d','e'] # reset again +>>> def generator(): +... addlist = ['f','g','h','i','j'] +... for i in addlist: +... if i != 'g': +... yield i +>>> v.extend(generator()) +>>> print_xvec(v) +[ a b c d e f h i j ] + ##################################################################### # vector of strings #####################################################################