2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 05:22:45 +00:00

added missing typename and include file

[SVN r19448]
This commit is contained in:
Joel de Guzman
2003-08-04 23:34:52 +00:00
parent ccede29816
commit 32c7088600
2 changed files with 5 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
# include <boost/python/class.hpp>
# include <boost/python/register_ptr_to_python.hpp>
# include <boost/python/indexing/detail/indexing_suite_detail.hpp>
# include <boost/python/iterator.hpp>
namespace boost { namespace python {
@@ -119,8 +120,9 @@ namespace boost { namespace python {
// Hook into the class_ generic visitation .def function
register_ptr_to_python<container_element_t>();
Container::iterator(Container::*begin_)() = &Container::begin;
Container::iterator(Container::*end_)() = &Container::end;
typedef typename Container::iterator iterator;
iterator(Container::*begin_)() = &Container::begin;
iterator(Container::*end_)() = &Container::end;
cl
.def("__len__", base_size)

View File

@@ -124,7 +124,7 @@ namespace boost { namespace python {
long index = i();
if (index < 0)
index += DerivedPolicies::size(container);
if (index >= container.size() || index < 0)
if (index >= long(container.size()) || index < 0)
{
PyErr_SetString(PyExc_IndexError, "Index out of range");
throw_error_already_set();