Boost logo

Boost :

Subject: [boost] [python] const-correctness and get_signature
From: Jim Bosch (talljimbo_at_[hidden])
Date: 2010-01-16 00:30:23


I've been working on an idea to provide optional const-handling in
boost.python wrapped classes. It's coming along pretty well, but I've
run into one major sticking point: the get_signature functions that
extract the argument types of member function pointers into mpl
sequences remove any cv-qualification on the hidden 'this' argument.
This seems to be intentional - from the comments in
python/signature.hpp:

// Note that cv-qualification is dropped from
// the "hidden this" argument of member functions; that is a
// necessary sacrifice to ensure that an lvalue from_python converter
// is used.

This doesn't actually seem necessary; for a normal wrapped class, the
special-case lvalue converter will always be the highest priority, and
for a const member function, supporting rvalue converters as a fall-back
wouldn't do any harm that I can see (and would help me out
considerably). Could this be a relic from before wrapped class lvalue
conversions were handled as a special case?

Anyhow, if my hypothesis is correct, and there isn't a need to drop the
cv-qualifiers in get_signature, I'd like to make a ticket and submit a
patch to change it - but I wanted to check here first to see if maybe
that breaks something else.

Thanks!

Jim Bosch


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk