[intrusive] Last step for Tru64/CXX support.

Hello, by now I have intrusive pass all regression tests locally. There is one modification left, which I'm not sure off, therefore I would like to ask for some advice before committing. All remaining failures are due to the implementation of offset_from_pointer_to_member(): template<class Parent, class Member> inline std::size_t offset_from_pointer_to_member( const Member Parent::* ptr_to_member) { #if ... // 1 return *(const std::ptrdiff_t*)(void*)&ptr_to_member; #elif ... // 2 const Parent * const parent = 0; const char *const member = reinterpret_cast<const char*>(&(parent->*ptr_to_member)); return std::size_t(member - reinterpret_cast<const char*>(parent)); #else ... // 3 return (*(const std::ptrdiff_t*)(void*)&ptr_to_member) - 1; #endif } Currently, variant #3 is chosen, which is obviously wrong. I tried both variant #1 and #2, and both seem to work for CXX. (All tests pass, no crashes.) So which variant should I choose? TIA, Markus

Markus Schöpflin escribió:
Hello,
by now I have intrusive pass all regression tests locally. There is one modification left, which I'm not sure off, therefore I would like to ask for some advice before committing.
All remaining failures are due to the implementation of offset_from_pointer_to_member():
template<class Parent, class Member> inline std::size_t offset_from_pointer_to_member( const Member Parent::* ptr_to_member) { #if ... // 1 return *(const std::ptrdiff_t*)(void*)&ptr_to_member; #elif ... // 2 const Parent * const parent = 0; const char *const member = reinterpret_cast<const char*>(&(parent->*ptr_to_member)); return std::size_t(member - reinterpret_cast<const char*>(parent)); #else ... // 3 return (*(const std::ptrdiff_t*)(void*)&ptr_to_member) - 1; #endif }
Currently, variant #3 is chosen, which is obviously wrong. I tried both variant #1 and #2, and both seem to work for CXX. (All tests pass, no crashes.) So which variant should I choose?
Whatever you want. The first option was added because it was the only one MSVC supports (otherwise, virtual base test crashes). If you don't care, put it on the second case. Regards, Ion
TIA, Markus
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Ion Gaztañaga wrote:
Markus Schöpflin escribió:
[...]
Currently, variant #3 is chosen, which is obviously wrong. I tried both variant #1 and #2, and both seem to work for CXX. (All tests pass, no crashes.) So which variant should I choose?
Whatever you want. The first option was added because it was the only one MSVC supports (otherwise, virtual base test crashes). If you don't care, put it on the second case.
OK, I committed #2 then. This should make intrusive pass all tests on this platform. Thank you for your help, Markus
participants (2)
-
Ion Gaztañaga
-
Markus Schöpflin