[Boost-bugs] [Boost C++ Libraries] #4797: Member hooks do not work with base classes

Subject: [Boost-bugs] [Boost C++ Libraries] #4797: Member hooks do not work with base classes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-27 13:32:26


#4797: Member hooks do not work with base classes
------------------------------+---------------------------------------------
 Reporter: mgaunard | Owner: igaztanaga
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: intrusive
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 It is not possible to do the following:

 {{{
 struct A
 {
     list_member_hook<> hook;
 };

 struct B : A
 {
 };

 typedef list<B, member_hook<A, list_member_hook<>, &A::hook> > mylist;
 }}}

 (Note &B::hook has type list_member_hook<> A::*, so putting B as the first
 parameter to member_hook doesn't work.)

 This results in a static assert that A and B are not the same type.

 The best way to fix this might be to add a base_member_hook<B, A,
 &A::hook> helper.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4797>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC