Opened 7 years ago

Closed 6 years ago

#4797 closed Feature Requests (fixed)

Member hooks do not work with base classes

Reported by: mgaunard Owned by: igaztanaga
Milestone: To Be Determined Component: intrusive
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:


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.

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by viboes

I would consider this as a feature request.

comment:2 Changed 6 years ago by igaztanaga

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

You can use function_hook to implement this feature in Boost 1.47

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain igaztanaga.
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.