I have a type called dReal, that can either be a float or double number type, depending on the build options. A member function in my class returns a dReal type, this is giving me problems in Boost. I am still new to boost, so i am not sure what to do. Here is the error i get: /usr/include/boost/python/detail/invoke.hpp:93: error: no match for call to `( boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning<const dReal*>) (const dReal*)' I've tried to use: return_internal_reference<>() return_value_policy<manage_new_object>()) return_value_policy<reference_existing_object>() but to no avail. Also i have member functions that take in a dReal number. What is the best way to pass that function a dReal type? Or can i just pass floats and doubles in python and boost will treat those as a dReal? thanks, -brett __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html
Is dReal a typedef for double or float? If so: Python float are immutable. You cannot return pointers to immutable types. Somehow you have to change your interface, e.g. through the use of "thin wrappers." Please explain in more detail what exactly you want to do; hopefully this will lead us to the best solution. Ralf --- brett hartshorn <bhartsho@yahoo.com> wrote:
I have a type called dReal, that can either be a float or double number type, depending on the build options. A member function in my class returns a dReal type, this is giving me problems in Boost. I am still new to boost, so i am not sure what to do.
Here is the error i get: /usr/include/boost/python/detail/invoke.hpp:93: error: no match for call to `(
boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning<const
dReal*>) (const dReal*)'
I've tried to use: return_internal_reference<>() return_value_policy<manage_new_object>()) return_value_policy<reference_existing_object>() but to no avail.
Also i have member functions that take in a dReal number. What is the best way to pass that function a dReal type? Or can i just pass floats and doubles in python and boost will treat those as a dReal?
__________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
participants (2)
-
brett hartshorn -
Ralf W. Grosse-Kunstleve