template<class T, typename U> ptrdiff_t foo(T U::* m) { // return offset }
在这种情况下,如何获得字段'm'的偏移量?我更喜欢使用am编译时表达式.
在此先感谢您的帮助.最好的祝福
c++ templates member-pointers
c++ ×1
member-pointers ×1
templates ×1