|
Boost Users : |
Subject: [Boost-users] Compile problems with instrusive::slist::push_back
From: Johannes Gajdosik (johannes.gajdosik_at_[hidden])
Date: 2009-05-15 18:47:18
From this piece of code
----------------------------------------
#include <boost/intrusive/slist.hpp>
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_at_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<typename
boost::intrusive::detail::eval_if_c<boost::intrusive::slist_impl<Config>::external_value_traits,
boost::intrusive::detail::eval_value_traits<typename
Config::value_traits>, boost::intrusive::detail::identity<typename
Config::value_traits> >::type::pointer>::reference) [with Config =
boost::intrusive::slistopt<boost::intrusive::detail::base_hook_traits<Node,
boost::intrusive::slist_node_traits<void*>, 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_at_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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net