source: NonGTP/Boost/boost/python/detail/api_placeholder.hpp @ 857

Revision 857, 587 bytes checked in by igarcia, 19 years ago (diff)
RevLine 
[857]1// Copyright David Abrahams 2002.
2// Distributed under the Boost Software License, Version 1.0. (See
3// accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5#ifndef BOOST_PYTHON_API_PLACE_HOLDER_HPP
6#define BOOST_PYTHON_API_PLACE_HOLDER_HPP
7
8namespace 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
17
18#endif // BOOST_PYTHON_API_PLACE_HOLDER_HPP
Note: See TracBrowser for help on using the repository browser.