On Friday, November 25, 2016 at 6:08:48 PM UTC+13, I wrote:
>
> If either of you are interested, I have an adaptation of the queue which 
> supports allocator_traits, movable types, and exception safety (basic or 
> noexcept, as appropriate, and BOOST_NO_EXCEPTIONS).
>
> It assumes at least C++11, though.  (Or technically, almost-C++11, since 
> it's mostly tested in VS2013.)
>

Have a look: https://gist.github.com/uecasm/b547db812ae4bba39bb1bd0443801507

(I marked it as secret just so that people don't stumble across it without 
the context; I don't mind it being used.)

I'm not 100% certain I have the allocator_traits officially correct (and 
I've omitted some constructors that would be required for stateful 
allocators that require initialisation), but it seems to work as expected.

With BOOST_NO_EXCEPTIONS defined the noexcept vs. except implementations 
end up being largely identical, although it will still exercise both paths 
depending on the declared types.  Didn't seem worthwhile chasing the tiny 
size optimisation that could potentially result from being aware of this. 
 A sufficiently clever compiler might do it itself, although it would 
surprise me.  Similarly mpmc_fixed_bounded_value could avoid the heap 
allocation if written differently, but sometimes that's not a good thing.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Scalable Synchronization Algorithms" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to lock-free+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/lock-free/ec4e0277-5b91-4ebd-8303-fa969904a822%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to