32#error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
53#ifndef ETL_SMALLEST_INCLUDED
54#define ETL_SMALLEST_INCLUDED
66#if ETL_USING_CPP11 && !defined(ETL_SMALLEST_TYPE_FORCE_CPP03_IMPLEMENTATION)
73 template <
typename T1,
typename...
TRest>
79 using smallest_other =
typename smallest_type<
TRest...>::type;
100 template <
typename T1>
101 class smallest_type<
T1>
114 template <
typename...
T>
119 template <
typename...
T>
140 template <
bool Boolean,
typename TrueType,
typename FalseType>
145 template <
typename TrueType,
typename FalseType>
153 template <
typename TrueType,
typename FalseType>
162 typedef typename smallest_type<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::type smallest_other;
166 typedef typename choose_type<(
sizeof(
T1) <
sizeof(smallest_other)),
181 template <
typename T1>
194 namespace private_smallest
200 struct best_fit_uint_type;
206 struct best_fit_uint_type<0>
215 struct best_fit_uint_type<1>
224 struct best_fit_uint_type<2>
229#if ETL_USING_64BIT_TYPES
259 struct best_fit_int_type<1>
268 struct best_fit_int_type<2>
273#if ETL_USING_64BIT_TYPES
291 template <
size_t NBITS>
297 static ETL_CONSTANT
int TYPE_INDEX = ((NBITS > 8) ? 1 : 0) +
298 ((NBITS > 16) ? 1 : 0) +
299 ((NBITS > 32) ? 1 : 0);
306 template <
size_t NBITS>
307 ETL_CONSTANT
int smallest_uint_for_bits<NBITS>::TYPE_INDEX;
310 template <
size_t NBITS>
320 template <
size_t NBITS>
321 struct smallest_int_for_bits
326 static ETL_CONSTANT
int TYPE_INDEX = ((NBITS > 8) ? 1 : 0) +
327 ((NBITS > 16) ? 1 : 0) +
328 ((NBITS > 32) ? 1 : 0);
332 typedef typename private_smallest::best_fit_int_type<TYPE_INDEX>::type type;
335 template <
size_t NBITS>
336 ETL_CONSTANT
int smallest_int_for_bits<NBITS>::TYPE_INDEX;
339 template <
size_t NBITS>
349 template <u
intmax_t VALUE>
350 struct smallest_uint_for_value
361 typedef typename private_smallest::best_fit_uint_type<TYPE_INDEX>::type type;
364 template <u
intmax_t VALUE>
365 ETL_CONSTANT
int smallest_uint_for_value<VALUE>::TYPE_INDEX;
368 template <u
intmax_t VALUE>
378 template <
intmax_t VALUE>
379 struct smallest_int_for_value
390 typedef typename private_smallest::best_fit_int_type<TYPE_INDEX>::type type;
393 template <
intmax_t VALUE>
394 ETL_CONSTANT
int smallest_int_for_value<VALUE>::TYPE_INDEX;
397 template <
intmax_t VALUE>
Definition smallest.h:136
Template to determine the smallest unsigned int type that can contain a value with the specified numb...
Definition smallest_generator.h:323
conditional
Definition type_traits_generator.h:1199
bitset_ext
Definition absolute.h:38
ETL_CONSTEXPR TContainer::size_type size(const TContainer &container)
Definition iterator.h:1187
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314
Definition smallest_generator.h:274
Definition smallest_generator.h:230
size_of
Definition type_traits_generator.h:1741