
On Mon, Jun 04, 2007 at 05:10:31PM +0200, Ion GaztaƱaga wrote:
Since I don't have access to a SunCC compiler you will need to help me discover how SunCC implements pointer to data members. I will need for
It's downloadable for free, both for Linux and Solaris :)
example the size of a pointer to data member (a simple sizeof(ptr_to_member) would be enough), and what the binary value of of that pointer to member for different layouts, say:
The program at the bottom prints the following for NN=10 and NN=20: 4 45 4 85 Do you need more information? == #include <iostream> #include <boost/intrusive/list.hpp> struct klass { void *data_[NN]; char ch_; boost::intrusive::list_member_hook<> hook_; typedef boost::intrusive::list< boost::intrusive::list_member_hook<>::value_traits< klass, &klass::hook_>, false> list; }; int main(void) { using std::cout; using std::endl; boost::intrusive::list_member_hook<> klass::*ptr = &klass::hook_; cout << sizeof(ptr) << ' ' << *(size_t*)&ptr << endl; return 0; } ==