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:
johannes@pc1:~/Progs/Components/Boost> g++ IntrusiveTest1.C
-Iboost_1_39_0
boost_1_39_0/boost/intrusive/slist.hpp: In member function
'void boost::intrusive::slist_impl<Config>::push_back(typename
std::iterator_traits::type::pointer>::reference) [with Config =
boost::intrusive::slistopt, safe_link,
boost::intrusive::default_tag, 2>, long unsigned int, true, false,
false>]': IntrusiveTest1.C:16: instantiated from here
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:
false>instantiated from here
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>'
This is boost_1_39_0. I use operating system
johannes@pc1:~/Progs/Components/Boost> uname -a
Linux pc1 2.6.22.19 #1 PREEMPT Fri Apr 10 00:41:29 CEST 2009 x86_64 AMD
Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux
and compiler gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5)
I cannot understand, why list.push_front(n1) compiles, while
list.push_back(n2) fails to compile.
Thanks in advance for your help.
Yours,
Johannes Gajdosik