[C++-sig] get_overload raising cannot convert from 'boost::python::detail::method_result' to 'MMOT::Geometry &'
Freyr Magnússon
freyr.magnusson at gmail.com
Mon Sep 7 10:20:21 CEST 2009
I'm using mscv8 from vs2005. I'll test your solutuion when I get the chance
later today.
Thanks,
Freyr
On Mon, Sep 7, 2009 at 4:41 AM, troy d. straszheim <troy at resophonic.com>wrote:
> Freyr Magnússon wrote:
>
>> I trying to create an interface wrapper for a class and I get an error:
>>
>> cannot convert from 'boost::python::detail::method_result' to
>> 'MMOT::Geometry &'
>>
>>
> Checking the code, I see method_result has a workaround for the
> conversion-operator-to-reference:
>
> class method_result {
> // ...
> # if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) ||
> BOOST_WORKAROUND(BOOST_INTEL_WIN, >= 900)
> // No operator T&
> # else
>
> template <class T>
> operator T&() const
> {
> converter::return_from_python<T&> converter;
> return converter(const_cast<handle<>&>(m_obj).release());
> }
> # endif
> };
>
> If this is why this:
>
> Geometry& getGeometry()
>> {
>> return this->get_override("getGeometry")();
>> }
>>
>
> Doesn't work (I don't know what that workaround means offhand but I'm going
> to guess it refers to old MSVC platforms), you could try
>
> Geometry* result = this->get_override("getGeometry")();
> return *result;
>
> So... what compiler are you using?
>
> -t
>
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090907/536ea6c8/attachment.htm>
More information about the Cplusplus-sig
mailing list