|
Boost : |
From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-12-09 07:44:46
>Lots of compilers (msvc, borland, metrowerks) currently don't handle
>conversions of cv-qualified member functions into cv-unqualified member
>functions correctly (yes, Virginia, that's a legal and correct implicit
>conversion). I'd like a config macro to detect that.
>BOOST_NO_POINTER_TO_MEMBER_CONST seems to be in the same area, but AFAICT
it
>means the opposite of what I'm looking for: the workaround in these cases
is
>to declare overloads.
I really had to think about that - it seems logical when you think about,
but I found this in the standard:
"12[Note: some conversions which involve only changes in cv-qualification
cannot be done using const_cast. For instance, conversions between
pointers to functions are not covered because such conversions lead to
values whose use causes undefined behavior. For the same reasons,
conversions between pointers to member functions, and in particular,
the conversion from a pointer to a const member function to a pointer
to a non-const member function, are not covered. ]"
And I can't find anything under "standard conversions" than would allow the
conversion you want. Are you sure that you are right here? Anyway,
assuming you are, just go ahead and add the macro, along with an
appropriate test case.
- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk