From 8ecd49cbf04f3a9cad15f950cef77a2b01dcf957 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 11 Oct 2005 13:19:05 +0000 Subject: [PATCH] Use "addressof(x)" instead of "&x" to deal with classes that have a private operator& !! [SVN r31279] --- include/boost/python/object/value_holder.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/boost/python/object/value_holder.hpp b/include/boost/python/object/value_holder.hpp index f7ba51bd..b12c6d82 100644 --- a/include/boost/python/object/value_holder.hpp +++ b/include/boost/python/object/value_holder.hpp @@ -29,6 +29,8 @@ # include # include +# include + namespace boost { namespace python { namespace objects { # if BOOST_WORKAROUND(__GNUC__, == 2) @@ -86,12 +88,12 @@ private: // required holder implementation template void* value_holder::holds(type_info dst_t, bool null_ptr_only) { - if (void* wrapped = holds_wrapped(dst_t, &m_held, &m_held)) + if (void* wrapped = holds_wrapped(dst_t, addressof(m_held), addressof(m_held))) return wrapped; type_info src_t = python::type_id(); - return src_t == dst_t ? &m_held - : find_static_type(&m_held, src_t, dst_t); + return src_t == dst_t ? addressof(m_held) + : find_static_type(addressof(m_held), src_t, dst_t); } template @@ -132,7 +134,7 @@ void* value_holder_back_reference::holds( BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) ) { - python::detail::initialize_wrapper(self, &this->m_held); + python::detail::initialize_wrapper(self, addressof(this->m_held)); } # undef N