6#include <bond/core/config.h>
8#include <boost/utility/enable_if.hpp>
21template <
typename Alloc,
typename Enable =
void>
24template <
typename Alloc>
25using empty_base_eligible = std::integral_constant<bool,
27 #if __cplusplus >= 201402L
28 && !std::is_final<Alloc>::value
30 && std::is_empty<Alloc>::value
31 && std::is_copy_constructible<Alloc>::value>;
33template <
typename Alloc>
34class allocator_holder<Alloc, typename boost::enable_if<empty_base_eligible<Alloc>>::type>
41 std::is_nothrow_copy_constructible<Alloc>::value)
45 const Alloc& get() const BOND_NOEXCEPT
50 Alloc& get() BOND_NOEXCEPT
56template <
typename Alloc>
57class allocator_holder<Alloc, typename boost::disable_if<empty_base_eligible<Alloc>>::type>
60 allocator_holder() =
default;
62 explicit allocator_holder(
const Alloc& alloc) BOND_NOEXCEPT_IF(
63 std::is_nothrow_copy_constructible<Alloc>::value)
67 const Alloc& get() const BOND_NOEXCEPT
72 Alloc& get() BOND_NOEXCEPT
Helper type that holds an allocator.
Definition: alloc.h:22
namespace bond
Definition: apply.h:17