Ticket #3489 (closed Feature Requests: fixed)

Opened 8 years ago

Last modified 7 years ago

using member objects as hooks

Reported by: anonymous Owned by: igaztanaga
Milestone: Boost 1.41.0 Component: intrusive
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc:


boost intrusive supports base hooks and member hooks, but if you need something like the following you're off to writing value and node traits:

struct B : list_base_hook<>{};

struct A{

B *b;


the value type of the list should be A, not B, so neither a base_hook nor a member hook can be used here.

so I suggest to add code like the one attached to this ticket, which allows you to do this:

struct get_b{

B &operator()(A const &a){

assert(a.b); return *a.b;



list<A,member_object_hook<A,list_base_hook<>,get_b> > mylist;


member_object_list.hpp (2.6 KB) - added by anonymous 8 years ago.

Change History

Changed 8 years ago by anonymous

comment:1 Changed 7 years ago by igaztanaga

  • Status changed from new to closed
  • Resolution set to fixed

Added function_hook for Boost 1.45 in release branch


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.