Opened 6 years ago

#12717 new Bugs

Incomplete documentation of boost::lockfree::queue::queue

Reported by: pmoran@… Owned by: timblechmann
Milestone: To Be Determined Component: lockfree
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

boost::lockfree::queue::queue(void) can only be called if if boost::lockfree::capacity was specified (as enforced by the BOOST_ASSERT in include/boost/lockfree/queue.hpp line 179. However this requirement is not enforced in a non-debug build and it is not mentioned in the documentation for boost::lockfree::queue::queue(void).

The same thing is true of boost::lockfree::queue::queue(allocator const &) in include/boost/lockfree/queue.hpp line 198 and of boost::lockfree::queue::queue(size_type) in include/boost/lockfree/queue.hpp line 210.

I think these restrictions should be included in the documentation. The docs would lead me to believe that one could write

void some_function() {
  boost::lockfree::queue<int> q;
}

But if that is built in debug mode it will fail the assertion in include/boost/lockfree/queue.hpp line 179

Change History (0)

Note: See TracTickets for help on using tickets.