0

In the following code:

using namespace boost::intrusive;

struct Data {
    int i;
private:
    list_member_hook<> list_node;     // How to make this work?
};


using List = list<
    Data,
    member_hook< Data, list_member_hook<>,
    &Data::list_node>      // compiler error here.
>;

How can I make list_node private?

tower120
  • 5,007
  • 6
  • 40
  • 88
  • 1
    Define list inside the Data class as public type, and then use it like `Data::list` – Victor Gubin Dec 14 '18 at 11:49
  • @VictorGubin Good idea... But maybe something less intrusive? Here https://github.com/facebook/folly/blob/master/folly/IntrusiveList.h says something about "befriend other"... – tower120 Dec 14 '18 at 11:55
  • @VictorGubin Actually, make this an answer - I'll accept it if found nothing else. – tower120 Dec 14 '18 at 13:27

0 Answers0