Boost C++ Libraries: Ticket #4797: Member hooks do not work with base classes https://svn.boost.org/trac10/ticket/4797 <p> It is not possible to do the following: </p> <pre class="wiki">struct A { list_member_hook&lt;&gt; hook; }; struct B : A { }; typedef list&lt;B, member_hook&lt;A, list_member_hook&lt;&gt;, &amp;A::hook&gt; &gt; mylist; </pre><p> (Note &amp;B::hook has type list_member_hook&lt;&gt; A::*, so putting B as the first parameter to member_hook doesn't work.) </p> <p> This results in a static assert that A and B are not the same type. </p> <p> The best way to fix this might be to add a base_member_hook&lt;B, A, &amp;A::hook&gt; helper. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4797 Trac 1.4.3 viboes Sat, 27 Nov 2010 15:40:11 GMT <link>https://svn.boost.org/trac10/ticket/4797#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4797#comment:1</guid> <description> <p> I would consider this as a feature request. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Fri, 01 Apr 2011 21:43:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4797#comment:2 https://svn.boost.org/trac10/ticket/4797#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> You can use function_hook to implement this feature in Boost 1.47 </p> Ticket