8 #include "../utility/builder.h"
16 template<
size_t Threshold,
typename P,
typename F>
22 template<
bool,
typename>
26 template<
bool R,
typename Alloc>
33 template<
bool R,
typename... Ts>
36 static_assert(
sizeof...(Ts) % 2 != 0,
"The number of allocators needs to match the number of thresholds + 1");
41 (
pow2<
sizeof...(Ts)>::Result - 1) / 2,
46 std::make_index_sequence<middle::first>,
47 std::make_index_sequence<middle::second>,
51 using threshold =
typename std::tuple_element_t<middle::first, std::tuple<Ts...>>;
66 template<
typename ...Ts>
74 template<
typename ...Ts>
81 using threshold = std::integral_constant<size_t, N>;
86 template<
typename T,
size_t Threshold,
typename P,
typename F>
92 template<
typename T,
size_t Threshold,
typename P,
typename F>
98 template<
typename T,
size_t Threshold,
typename P,
typename F>
An allocator which delegates allocations between 2 different allocators based on a size threshold.
Definition: segragator.h:21
Wrapper class for making an untyped allocator into a typed allocator.
Definition: type_allocator.h:20
Definition: cascading.h:15
typename detail::segragator_builder< true, std::tuple< Ts... > >::type segragator_builder_max
A type builder for a right-leaning segragator allocator.
Definition: segragator_fwd.h:75
std::integral_constant< size_t, N > threshold
A shorthand way of writing std::integral_constant<size_t, N>
Definition: segragator_fwd.h:81
typename detail::segragator_builder< false, std::tuple< Ts... > >::type segragator_builder_min
A type builder for a left-leaning segragator allocator.
Definition: segragator_fwd.h:67
Alloc type
Definition: segragator_fwd.h:29
typename std::tuple_element_t< middle::first, std::tuple< Ts... > > threshold
Definition: segragator_fwd.h:51
typename segragator_builder< R, typename split::second >::type second
Definition: segragator_fwd.h:55
typename segragator_builder< R, typename split::first >::type first
Definition: segragator_fwd.h:54
Definition: segragator_fwd.h:23