Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/boost/python/detail/api_placeholder.hpp @ 18

Last change on this file since 18 was 12, checked in by landauf, 18 years ago

added boost

File size: 569 bytes
Line 
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.