Yes, a reinterpret_cast
round-trip between pointer-to-member types is guaranteed to be valid, as long as you keep it pointer-to-data-member or pointer-to-member-function in both cases.
Quoting C++11:
[expr.reinterpret.cast]
10 A prvalue of type "pointer to member of
X
of typeT1
" can be explicitly converted to a prvalue of a different type "pointer to member ofY
of typeT2
" ifT1
andT2
are both function types or both object types. The null member pointer value (4.11) is converted to the null member pointer value of the destination type. The result of this conversion is unspecified, except in the following cases:
- converting a prvalue of type "pointer to member function" to a different pointer to member function type and back to its original type yields the original pointer to member value.