mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 06:02:14 +00:00
Use "addressof(x)" instead of "&x" to deal with classes that have a
private operator& !! [SVN r31279]
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
# include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
# include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
|
||||
# include <boost/utility/addressof.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace objects {
|
||||
|
||||
# if BOOST_WORKAROUND(__GNUC__, == 2)
|
||||
@@ -86,12 +88,12 @@ private: // required holder implementation
|
||||
template <class Value>
|
||||
void* value_holder<Value>::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<Value>();
|
||||
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 <class Value, class Held>
|
||||
@@ -132,7 +134,7 @@ void* value_holder_back_reference<Value,Held>::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
|
||||
|
||||
Reference in New Issue
Block a user