The missing documentation is a Doxygen bug, the documentation page gets the name from a MACRO :(, and it is here: http://www.boost.org/doc/libs/1_55_0/doc/html/boost/lockfree/BOOST_NO_CXX1_idp100289128.html
Indeed the stack appears to have the same element type requirements as the queue, despite the fact that the documentation doesn't mention it. What's worse, it seems that
boost::string_ref
hasn't been kept a POD either.
So my suggestion would be to store pointers into a "pool" of immutable string objects and just free the pool at the time when the queue is freed. This way, you just have to manage the lifetime of the queue in such a way that the memory consumption doesn't grow out of control.
In some ways this resembles implementing a poor-man's GC, and yes, it will force regular delays in the throughput to re-initialize the queue; In fairness is common to the field of lock-less memory management, and as the Boost Lockfree documentation states, most "viable" memory reclamation schemes in existence are patented.
You might have a look at libcds: Lock-free Concurrent Datastructures in case you want to toy with some of these algorithms. I think the author of that library has been in active conversation with Boost developers about proposing libcds
for Boost, and it likely did not take place because of the patent issues.