Nicolas Lelong wrote:
You may disambiguate by using a cast inside .def(), such as
.def("getA", (A*(B::*)())B::getA);
Whether that's actually more readable is arguable, however.
IMHO, this is quite dangerous as the explicit cast prevents the compiler
to give you a proper error if the signa
Jean-Sébastien Guay wrote:
> Hi Stefan,
>
>> This is not a wrapper function, but an alias. You create a new variable
>> 'B_getA1', and make this point to B::getA (the non-const version).
>> This works, since by means of the variable type you disambiguate, so
>> using that in the call to def() wor
You may disambiguate by using a cast inside .def(), such as
.def("getA", (A*(B::*)())B::getA);
Whether that's actually more readable is arguable, however.
IMHO, this is quite dangerous as the explicit cast prevents the compiler to
give you a proper error if the signature of B::getA changes
Hi Stefan,
This is not a wrapper function, but an alias. You create a new variable
'B_getA1', and make this point to B::getA (the non-const version).
This works, since by means of the variable type you disambiguate, so
using that in the call to def() works unambiguously.
Sorry, thanks for cor
On 09/08/2009 11:30 PM, Jean-Sébastien Guay wrote:
If I just add .def("getA", &B::getA, some_return_policy) to my class_
wrapper, on compile it will complain that it doesn't know which
version of B::getA() I want. Up until now the way I wrapped this was
to make a trivial wrapper function:
A