mirror of
https://github.com/boostorg/python.git
synced 2026-01-19 16:32:16 +00:00
https://svn.boost.org/svn/boost/trunk ........ r41544 | jhunold | 2007-12-01 20:27:06 +0100 (Sa, 01 Dez 2007) | 2 lines Silence compiler by adding cosmetic virtual destructors. ........ r41549 | jhunold | 2007-12-01 21:24:51 +0100 (Sa, 01 Dez 2007) | 2 lines Silence compiler by adding cosmetic virtual destructors. ........ r41550 | jhunold | 2007-12-01 21:26:37 +0100 (Sa, 01 Dez 2007) | 3 lines Remove unused paramters. Add -Wextra to gcc flags to enable more warnings. ........ r41577 | jhunold | 2007-12-02 12:51:08 +0100 (So, 02 Dez 2007) | 3 lines Revert revisions 41544 and 41549. See http://lists.boost.org/Archives/boost/2007/12/131116.php for details. ........ r41649 | jhunold | 2007-12-03 19:47:17 +0100 (Mo, 03 Dez 2007) | 2 lines Silence unused paramter warning in release mode. ........ r41650 | jhunold | 2007-12-03 19:51:26 +0100 (Mo, 03 Dez 2007) | 2 lines Add cosmetic virtual detructors to silence compile warnings. ........ [SVN r42094]
34 lines
1.0 KiB
C++
Executable File
34 lines
1.0 KiB
C++
Executable File
// Copyright David Abrahams 2002.
|
|
// Distributed under the Boost Software License, Version 1.0. (See
|
|
// accompanying file LICENSE_1_0.txt or copy at
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
|
#include <boost/python/detail/wrap_python.hpp>
|
|
#include <boost/python/borrowed.hpp>
|
|
#include <boost/static_assert.hpp>
|
|
|
|
using namespace boost::python;
|
|
|
|
template <class T>
|
|
void assert_borrowed_ptr(T const&)
|
|
{
|
|
BOOST_STATIC_ASSERT(boost::python::detail::is_borrowed_ptr<T>::value);
|
|
}
|
|
|
|
template <class T>
|
|
void assert_not_borrowed_ptr(T const&)
|
|
{
|
|
BOOST_STATIC_ASSERT(!boost::python::detail::is_borrowed_ptr<T>::value);
|
|
}
|
|
|
|
int main()
|
|
{
|
|
assert_borrowed_ptr(borrowed((PyObject*)0));
|
|
assert_borrowed_ptr(borrowed((PyTypeObject*)0));
|
|
assert_borrowed_ptr((detail::borrowed<PyObject> const*)0);
|
|
assert_borrowed_ptr((detail::borrowed<PyObject> volatile*)0);
|
|
assert_borrowed_ptr((detail::borrowed<PyObject> const volatile*)0);
|
|
assert_not_borrowed_ptr((PyObject*)0);
|
|
assert_not_borrowed_ptr(0);
|
|
return 0;
|
|
}
|