2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 05:42:30 +00:00

destroy_reference -> destroy_referent

[SVN r14486]
This commit is contained in:
Dave Abrahams
2002-07-17 01:53:33 +00:00
parent 1d2dc98f50
commit 134bc44c45
3 changed files with 11 additions and 11 deletions

View File

@@ -129,7 +129,7 @@ template <class T>
inline rvalue_from_python_data<T>::~rvalue_from_python_data()
{
if (this->stage1.convertible == this->storage.bytes)
python::detail::destroy_reference<ref_type>(this->storage.bytes);
python::detail::destroy_referent<ref_type>(this->storage.bytes);
}
}}} // namespace boost::python::converter

View File

@@ -62,7 +62,7 @@ struct value_destroyer<false,true>
};
template <class T>
inline void destroy_reference_impl(void* p, T& (*)())
inline void destroy_referent_impl(void* p, T& (*)())
{
// note: cv-qualification needed for MSVC6
// must come *before* T for metrowerks
@@ -73,9 +73,9 @@ inline void destroy_reference_impl(void* p, T& (*)())
}
template <class T>
inline void destroy_reference(void* p, T(*)() = 0)
inline void destroy_referent(void* p, T(*)() = 0)
{
destroy_reference_impl(p, (T(*)())0);
destroy_referent_impl(p, (T(*)())0);
}
}}} // namespace boost::python::detail

View File

@@ -5,7 +5,7 @@ struct bar;
namespace boost
{
// lie to the library about bar so we can show that it's destructor is optimized away.
// lie to the library about bar so we can show that its destructor is optimized away.
template <>
struct has_trivial_destructor<bar>
{
@@ -48,33 +48,33 @@ int main()
typedef int a[2];
foo* f1 = new foo;
boost::python::detail::destroy_reference<foo const volatile&>(f1);
boost::python::detail::destroy_referent<foo const volatile&>(f1);
assert_destructions(1);
foo* f2 = new foo[2];
typedef foo x[2];
boost::python::detail::destroy_reference<x const&>(f2);
boost::python::detail::destroy_referent<x const&>(f2);
assert_destructions(3);
typedef foo y[2][2];
x* f3 = new y;
boost::python::detail::destroy_reference<y&>(f3);
boost::python::detail::destroy_referent<y&>(f3);
assert_destructions(7);
bar* b1 = new bar;
boost::python::detail::destroy_reference<bar&>(b1);
boost::python::detail::destroy_referent<bar&>(b1);
assert_destructions(7);
bar* b2 = new bar[2];
typedef bar xb[2];
boost::python::detail::destroy_reference<xb&>(b2);
boost::python::detail::destroy_referent<xb&>(b2);
assert_destructions(7);
typedef bar yb[2][2];
xb* b3 = new yb;
boost::python::detail::destroy_reference<yb&>(b3);
boost::python::detail::destroy_referent<yb&>(b3);
assert_destructions(7);
return 0;