2 // Copyright Oliver Kowalke 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_FIBERS_DETAIL_SHARED_STATE_OBJECT_H
8 #define BOOST_FIBERS_DETAIL_SHARED_STATE_OBJECT_H
12 #include <boost/config.hpp>
14 #include <boost/fiber/detail/config.hpp>
15 #include <boost/fiber/future/detail/shared_state.hpp>
17 #ifdef BOOST_HAS_ABI_HEADERS
18 # include BOOST_ABI_PREFIX
25 template< typename R, typename Allocator >
26 class shared_state_object : public shared_state< R > {
28 typedef typename std::allocator_traits< Allocator >::template rebind_alloc<
32 shared_state_object( allocator_t const& alloc) :
33 shared_state< R >(), alloc_( alloc) {
37 void deallocate_future() noexcept override final {
38 destroy_( alloc_, this);
44 static void destroy_( allocator_t const& alloc, shared_state_object * p) noexcept {
45 allocator_t a{ alloc };
53 #ifdef BOOST_HAS_ABI_HEADERS
54 # include BOOST_ABI_SUFFIX
57 #endif // BOOST_FIBERS_DETAIL_SHARED_STATE_OBJECT_H