// compile with: // g++ -std=c++11 -Wall -Wextra -pedantic -g3 -O0 -I${BOOST_INCLUDE} #include #include #include namespace bi = boost::intrusive; struct A { A(int val = 0) : val_(val), prev_(nullptr), next_(nullptr) {} ~A() { prev_ = nullptr; next_ = nullptr; } int val_; A* prev_; A* next_; }; struct Node_Traits { typedef A node; typedef A* node_ptr; typedef const A* const_node_ptr; static node *get_next(const node *n) { return n->next_; } static void set_next(node *n, node *next) { n->next_ = next; } static node *get_previous(const node *n) { return n->prev_; } static void set_previous(node *n, node *prev) { n->prev_ = prev; } }; typedef bi::trivial_value_traits< Node_Traits, bi::safe_link > Value_Traits; typedef bi::list< A, bi::value_traits< Value_Traits > > list_t; int main() { { list_t l; (void)l; } std::cout << "never reached\n"; }