Re: [boost] [lockfree] Faulty (?) static assert

The lockfree::queue constructors raise a static assert if no capacity is specified. This contradicts the member initialization code close to the assert, for instance:
queue(void): head_(tagged_node_handle(0, 0)), tail_(tagged_node_handle(0, 0)), pool(node_allocator(), has_capacity ? capacity : 0) { BOOST_STATIC_ASSERT(has_capacity); initialize(); }
which implies that 'has_capacity' is allowed to be false. From what I can see 'has_capacity' could be false, indeed, in particular if the queue is not bounded in size.
Would changing this to
queue(void): head_(tagged_node_handle(0, 0)), tail_(tagged_node_handle(0, 0)), pool(node_allocator(), has_capacity ? capacity : 0) { BOOST_STATIC_ASSERT(has_capacity || capacity); initialize(); }
reflect the actual intention?
Sorry, I meant:
BOOST_STATIC_ASSERT(has_capacity || !capacity);
Regards Hartmut --------------- http://boost-spirit.com http://stellar.cct.lsu.edu
Regards Hartmut --------------- http://boost-spirit.com http://stellar.cct.lsu.edu
participants (1)
-
Hartmut Kaiser