From e552607c95cf513a8f3e1f3c1ce123c909356fd1 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 22 Sep 2001 17:51:10 +0000 Subject: [PATCH] const-ified list::size() and slice_proxy::size() [SVN r11212] --- include/boost/python/objects.hpp | 4 ++-- src/objects.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/python/objects.hpp b/include/boost/python/objects.hpp index 34052e1f..3b1a9094 100644 --- a/include/boost/python/objects.hpp +++ b/include/boost/python/objects.hpp @@ -101,7 +101,7 @@ class list : public object explicit list(std::size_t sz = 0); static PyTypeObject* type_obj(); static bool accepts(ref p); - std::size_t size(); + std::size_t size() const; ref operator[](std::size_t pos) const; proxy operator[](std::size_t pos); ref get_item(std::size_t pos) const; @@ -283,7 +283,7 @@ struct list::slice_proxy const list& operator=(const list& rhs); operator ref() const; operator list() const; - std::size_t size(); + std::size_t size() const; ref operator[](std::size_t pos) const; private: friend class list; diff --git a/src/objects.cpp b/src/objects.cpp index cc46b2ba..125a1eb8 100644 --- a/src/objects.cpp +++ b/src/objects.cpp @@ -362,7 +362,7 @@ bool list::accepts(ref p) return PyList_Check(p.get()); } -std::size_t list::size() +std::size_t list::size() const { return PyList_Size(get()); } @@ -467,7 +467,7 @@ list::slice_proxy::operator list() const return list(this->operator ref()); } -std::size_t list::slice_proxy::size() +std::size_t list::slice_proxy::size() const { return this->operator list().size(); }