
Gordon Woodhull escribió:
I'm not sure if it's that simple. The nodes aren't PODs so I don't think 'offsetof' can't be used to get their address (or can it? I've never used it).
No, not without making them PODs.
MultiIndex copes by using aligned_storage and manually constructing the value in place, so that it can get the containing structures address.
I'd like to point out that there is also intrusive::detail::parent_from_member, which Ion and I have proposed to move into boost::detail as I think I need it for a fusion-intrusive adapter. (http://lists.boost.org/Archives/boost/2008/06/139094.php)
There is some scary code in parent_from_member but AFAIK it works everywhere.
Not everywhere, I'm afraid: http://lists.boost.org/boost-users/2007/06/28382.php There are definitely some seriously non-standard tricks there that should IMHO discourage us from using parent_from_member unrestrictedly, useful as this utility may be. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo