From: Bruno H. <br...@cl...> - 2002-12-20 16:07:15
|
Sam writes: > can we "use pointer to member instead"? :-) As I said, I don't think an 'offsetof' that uses pointer to member and then a cast to 'int' would be more portable than the one we have currently. > what's POD type? "Plain old data". A C++ struct/class type that has no user-defined copy-assignment operator, destructor etc. See http://www.kuzbass.ru:8086/docs/isocpp/ chapter 9. > > I think casting a pointer to member to function to 'int' in C++ is > > even more risky than using offsetof, because the internal > > representation of a pointer to member function is unspecified (and > > often takes more than 4 bytes). > > can you write a cast operator? It is not possible to write a user-defined cast operator from pointer-to-member-function to int in C++. Bruno |