File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,11 +183,16 @@ <h2>Contents</h2>
183183 < dt > < a href ="#binary-spec "> binary operations</ a > </ dt >
184184
185185 < dt > < a href ="#assignment-spec "> assignment operations</ a > </ dt >
186+
186187 </ dl >
187188
188189 < dl class ="page-index ">
189190 < dt > < a href ="#object_operators-spec "> operators</ a > </ dt >
190191 </ dl >
192+
193+ < dl class ="page-index ">
194+ < dt > < a href ="#len-spec "> len()</ a > </ dt >
195+ </ dl >
191196 </ dd >
192197
193198 < dt > < a href ="#examples "> Example</ a > </ dt >
@@ -918,16 +923,36 @@ <h2><a name="examples"></a>Example</h2>
918923 result += seq[i];
919924 return result;
920925}
926+ </ pre >
927+
928+ < h4 > < a name ="len-spec "> len()</ a > </ h4 >
929+ < pre >
930+ inline long len(object const& obj);
931+ </ pre >
932+
933+ < dl class ="function-semantics ">
934+ < dt > < b > Effects:</ b > PyObject_Length(obj.ptr()) </ dt >
935+ < dt > < b > Returns:</ b > len() of object.</ dt >
936+ </ dl >
937+
938+ < h2 > < a name ="examples "> </ a > Example</ h2 >
939+ Python code:
940+ < pre >
941+ len(obj)
942+ </ pre >
943+ C++ version:
944+ < pre >
945+ len(obj);
921946</ pre >
922947
923948 < p > Revised
924949 <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
925- 13 November, 2002
950+ 12 January, 2006
926951 <!--webbot bot="Timestamp" endspan i-checksum="39359" -->
927952 </ p >
928953
929954 < p > < i > © Copyright < a href =
930- "../../../../people/dave_abrahams.htm "> Dave Abrahams</ a > 2002 .</ i > </ p >
955+ "../../../../people/dave_abrahams.htm "> Dave Abrahams</ a > 2006 .</ i > </ p >
931956 </ body >
932957</ html >
933958
Original file line number Diff line number Diff line change 22// Distributed under the Boost Software License, Version 1.0. (See
33// accompanying file LICENSE_1_0.txt or copy at
44// http://www.boost.org/LICENSE_1_0.txt)
5+
6+ // DEPRECATED HEADER (2006 Jan 12)
7+ // Provided only for backward compatibility.
8+ // The boost::python::len() function is now defined in object.hpp.
9+
510#ifndef BOOST_PYTHON_API_PLACE_HOLDER_HPP
611#define BOOST_PYTHON_API_PLACE_HOLDER_HPP
712
8- namespace boost { namespace python {
9-
10- inline long len (object const & obj)
11- {
12- long result = PyObject_Length (obj.ptr ());
13- if (PyErr_Occurred ()) throw_error_already_set ();
14- return result;
15- }
16- }} // namespace boost::python
13+ #include < boost/python/object.hpp>
1714
1815#endif // BOOST_PYTHON_API_PLACE_HOLDER_HPP
Original file line number Diff line number Diff line change 1313# include < boost/python/object_operators.hpp>
1414# include < boost/python/converter/arg_to_python.hpp>
1515
16+ namespace boost { namespace python {
17+
18+ inline long len (object const & obj)
19+ {
20+ long result = PyObject_Length (obj.ptr ());
21+ if (PyErr_Occurred ()) throw_error_already_set ();
22+ return result;
23+ }
24+
25+ }} // namespace boost::python
26+
1627#endif // OBJECT_DWA2002612_HPP
Original file line number Diff line number Diff line change 1212#include < boost/python/str.hpp>
1313#include < boost/python/extract.hpp>
1414#include < boost/python/object_protocol.hpp>
15- #include < boost/python/detail/api_placeholder.hpp>
1615#include < structmember.h>
1716#include < cstdio>
1817
Original file line number Diff line number Diff line change 1515#include < boost/python/tuple.hpp>
1616#include < boost/python/list.hpp>
1717
18- #include < boost/python/detail/api_placeholder.hpp>
1918#include < boost/python/detail/signature.hpp>
2019#include < boost/mpl/vector/vector10.hpp>
2120
Original file line number Diff line number Diff line change 88#include < boost/python/tuple.hpp>
99#include < boost/python/list.hpp>
1010#include < boost/python/dict.hpp>
11- #include < boost/python/detail/api_placeholder.hpp>
1211
1312namespace boost { namespace python {
1413
Original file line number Diff line number Diff line change 2727#include < boost/python/class.hpp>
2828#include < boost/python/tuple.hpp>
2929#include < boost/python/extract.hpp>
30- #include < boost/python/detail/api_placeholder.hpp>
3130
3231namespace { // Avoid cluttering the global namespace.
3332
Original file line number Diff line number Diff line change 2323#include < boost/python/tuple.hpp>
2424#include < boost/python/dict.hpp>
2525#include < boost/python/extract.hpp>
26- #include < boost/python/detail/api_placeholder.hpp>
2726#include < boost/python/back_reference.hpp>
2827
2928namespace { // Avoid cluttering the global namespace.
You can’t perform that action at this time.
0 commit comments