1#ifndef ZSERIO_TRAITS_H_INC
2#define ZSERIO_TRAITS_H_INC
11template <
typename, std::
size_t>
17template <
typename T,
typename ARRAY_TRAITS>
20template <
typename ALLOC,
typename T>
34struct always_false : std::false_type
37template <
typename VALUE_TYPE>
38class NumericTypeWrapper;
40template <
typename VALUE_TYPE>
43template <
typename T,
typename =
void>
44struct is_allocator_impl : std::false_type
48struct is_allocator_impl<T,
49 std::void_t<typename T::value_type, decltype(std::declval<T>().allocate(0)),
50 decltype(std::declval<T>().deallocate(std::declval<typename T::value_type*>(), 0))>>
55struct is_array_view : std::false_type
58template <
typename T,
typename ARRAY_TRAITS>
59struct is_array_view<ArrayView<T, ARRAY_TRAITS>> : std::true_type
63constexpr bool is_array_view_v = is_array_view<T>::value;
66struct is_view : std::false_type
70struct is_view<
View<T>> : std::true_type
74constexpr bool is_view_v = is_view<T>::value;
77struct needs_offset_reference : std::negation<is_view<T>>
81struct needs_offset_reference<Extended<T>>
83 static constexpr bool value = needs_offset_reference<T>::value;
86template <
typename ALLOC,
typename T>
87struct needs_offset_reference<BasicOptional<ALLOC, T>>
89 static constexpr bool value = needs_offset_reference<T>::value;
93constexpr bool needs_offset_reference_v = needs_offset_reference<T>::value;
113template <
typename...
ARGS>
117template <
typename T,
typename...
ARGS>
121template <
typename...
ARGS>
129template <
typename T,
typename =
void>
137template <
typename T,
typename V =
void>
145template <
typename...
ARGS>
149template <
typename T,
typename...
ARGS>
153template <
typename...
ARGS>
161template <
typename T,
typename =
void>
170template <
typename T,
typename V =
void>
184template <
typename T,
size_t Extent>
197template <
typename T,
typename =
void>
203 std::
enable_if_t<std::is_base_of_v<detail::NumericTypeWrapper<typename T::ValueType>, T>>>
207template <
typename T,
typename V =
void>
213template <
typename T,
typename =
void>
219 std::
enable_if_t<std::is_base_of_v<detail::DynIntWrapper<typename T::ValueType>, T>>> : std::true_type
222template <
typename T,
typename V =
void>
229template <
typename T,
typename =
void>
246template <
typename T,
typename =
void>
258template <
typename T,
typename V =
void>
267template <
typename T,
typename =
void>
279template <
typename T,
typename V =
void>
290template <
typename T,
typename ALLOC,
typename...
ARGS>
293 if constexpr (std::is_constructible_v<T,
ARGS...,
ALLOC>)
299 return T(std::forward<ARGS>(
args)...);
309template <
typename T,
typename ALLOC,
typename U, std::enable_if_t<is_numeric_wrapper_v<T>,
int> = 0>
312 return T(
static_cast<typename T::ValueType
>(value));
constexpr bool is_complete_v
typename offset_field_reference< T, V >::type offset_field_reference_t
constexpr bool is_allocator_v
constexpr bool is_dyn_int_wrapper_v
constexpr T constructWithAllocator(const ALLOC &allocator, ARGS &&... args)
constexpr bool is_numeric_wrapper_v
constexpr bool is_bitmask_v
View(T, ARGS &&...) -> View< T >
constexpr bool has_allocator_v
typename view_type< T, V >::type view_type_t
constexpr bool is_first_allocator_v
constexpr bool is_first_array_preallocation_v