Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:07:12

0001 // Copyright David Abrahams 2002.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef OBJECT_DWA2002612_HPP
0006 # define OBJECT_DWA2002612_HPP
0007 
0008 # include <boost/python/ssize_t.hpp>
0009 # include <boost/python/object_core.hpp>
0010 # include <boost/python/object_attributes.hpp>
0011 # include <boost/python/object_items.hpp>
0012 # include <boost/python/object_slices.hpp>
0013 # include <boost/python/object_operators.hpp>
0014 # include <boost/python/converter/arg_to_python.hpp>
0015 
0016 namespace boost { namespace python {
0017 
0018     inline ssize_t len(object const& obj)
0019     {
0020         ssize_t result = PyObject_Length(obj.ptr());
0021         if (PyErr_Occurred()) throw_error_already_set();
0022         return result;
0023     }
0024 
0025 }} // namespace boost::python
0026 
0027 #endif // OBJECT_DWA2002612_HPP