Boost logo

Boost :

Subject: [boost] [intrusive] recursive intrusive data structures
From: Tim Blechmann (tim_at_[hidden])
Date: 2010-06-14 03:39:19

hi all,

is there an easy way to define recursive data structures?
something like:

struct my_node: boost::intrusive::list_base_hook<>
    boost::intrusive::list<my_node> children;

i am currently using a base class as helper, which causes very dirty code,
since i explicitly need to cast from the base to the main class all over the

struct my_node_base: boost::intrusive::list_base_hook<> {};

struct node: my_node_base
    boost::intrusive::list<my_node_base> children;

thanks, tim

Life is really simple, but we insist on making it complicated.

Boost list run by bdawes at, gregod at, cpdaniel at, john at