
AMDG Johannes Gajdosik wrote:
From this piece of code
#include
class Node : public boost::intrusive::slist_base_hook<> { public: Node(int x) : x(x) {} int x; };
typedef boost::intrusive::slist<Node> List;
int main(int argc,char *argv[]) { List list; Node n1(1234); Node n2(5678); list.push_front(n1); list.push_back(n2); return 0; } ------------------------------------------ I get the following error:
false>boost_1_39_0/boost/intrusive/slist.hpp:382: error: invalid false>application of 'sizeof' to incomplete type false>'boost::STATIC_ASSERTION_FAILURE<false>' IntrusiveTest1.C:16:
The line that triggers the error is
BOOST_STATIC_ASSERT((cache_last != 0));
slist does not support push_back by default.
To allow push_back, you need to add the option cache_last:
typedef boost::intrisive::slist