31#ifndef ETL_SMALLEST_INCLUDED
32#define ETL_SMALLEST_INCLUDED
44#if ETL_USING_CPP11 && !defined(ETL_SMALLEST_TYPE_FORCE_CPP03_IMPLEMENTATION)
51 template <
typename T1,
typename... TRest>
58 using smallest_other =
typename smallest_type<TRest...>::type;
64 using type =
typename etl::conditional<(etl::size_of<T1>::value < etl::size_of< smallest_other>::value),
72 size = etl::size_of<type>::value
79 template <
typename T1>
88 size = etl::size_of<type>::value
93 template <
typename... T>
98 template <
typename... T>
103 #include "private/smallest_cpp03.h"
106 namespace private_smallest
120 typedef uint_least8_t type;
129 typedef uint_least16_t type;
138 typedef uint_least32_t type;
141#if ETL_USING_64BIT_TYPES
148 typedef uint_least64_t type;
164 typedef int_least8_t type;
173 typedef int_least16_t type;
182 typedef int_least32_t type;
185#if ETL_USING_64BIT_TYPES
192 typedef int_least64_t type;
203 template <
size_t NBITS>
210 static ETL_CONSTANT
int TYPE_INDEX = ((NBITS > 8) ? 1 : 0) + ((NBITS > 16) ? 1 : 0) + ((NBITS > 32) ? 1 : 0);
217 template <
size_t NBITS>
218 ETL_CONSTANT
int smallest_uint_for_bits<NBITS>::TYPE_INDEX;
221 template <
size_t NBITS>
222 using smallest_uint_for_bits_t =
typename smallest_uint_for_bits<NBITS>::type;
231 template <
size_t NBITS>
238 static ETL_CONSTANT
int TYPE_INDEX = ((NBITS > 8) ? 1 : 0) + ((NBITS > 16) ? 1 : 0) + ((NBITS > 32) ? 1 : 0);
245 template <
size_t NBITS>
246 ETL_CONSTANT
int smallest_int_for_bits<NBITS>::TYPE_INDEX;
249 template <
size_t NBITS>
250 using smallest_int_for_bits_t =
typename smallest_int_for_bits<NBITS>::type;
259 template <u
intmax_t VALUE>
265 static ETL_CONSTANT
int TYPE_INDEX = ((VALUE > UINT_LEAST8_MAX) ? 1 : 0) + ((VALUE > UINT16_MAX) ? 1 : 0) + ((VALUE > UINT32_MAX) ? 1 : 0);
272 template <u
intmax_t VALUE>
273 ETL_CONSTANT
int smallest_uint_for_value<VALUE>::TYPE_INDEX;
276 template <u
intmax_t VALUE>
277 using smallest_uint_for_value_t =
typename smallest_uint_for_value<VALUE>::type;
286 template <
intmax_t VALUE>
292 static ETL_CONSTANT
int TYPE_INDEX = (((VALUE > intmax_t(INT_LEAST8_MAX)) || (VALUE < intmax_t(INT_LEAST8_MIN))) ? 1 : 0)
293 + (((VALUE > intmax_t(INT16_MAX)) || (VALUE < intmax_t(INT16_MIN))) ? 1 : 0)
294 + (((VALUE > intmax_t(INT32_MAX)) || (VALUE < intmax_t(INT32_MIN))) ? 1 : 0);
301 template <
intmax_t VALUE>
302 ETL_CONSTANT
int smallest_int_for_value<VALUE>::TYPE_INDEX;
305 template <
intmax_t VALUE>
306 using smallest_int_for_value_t =
typename smallest_int_for_value<VALUE>::type;
Definition smallest.h:233
Definition smallest.h:288
Definition smallest.h:205
Definition smallest.h:261
bitset_ext
Definition absolute.h:40
ETL_CONSTEXPR TContainer::size_type size(const TContainer &container)
Definition iterator.h:1192
Definition smallest.h:156
Definition smallest.h:112