|
Boost Users : |
From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2008-05-15 12:53:57
Hi,
I have a class X : public intrusive::list_base_hook<> and would like
to embed an additional member bool using the pointer_plus_bit.
Can this be achieved using the value_traits somehow, and have the list
working 'appropriately'?
example code:
#include <boost/function/function0.hpp>
#include <boost/intrusive/list.hpp>
#include <boost/intrusive/pointer_plus_bit.hpp>
struct X : public boost::intrusive::list_base_hook<>
{
template<typename F>
X(F const& f) : f_(f) {}
boost::function0<void> f_;
};
void foo() {}
void test_intrusive()
{
typedef boost::intrusive::list<X> ilist;
ilist list;
list.push_back(*(new X(&foo)));
X& x = list.back();
// How to set/get the bit on x?
};
Thanks,
Christian
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