11#ifndef M5_UTILITY_STL_EXTENSION_HPP
12#define M5_UTILITY_STL_EXTENSION_HPP
23constexpr auto size(
const C& c) ->
decltype(c.size())
29template <
typename T,
size_t N>
30constexpr auto size(
const T (&)[N])
noexcept ->
size_t
43#if __cplusplus >= 201703L
47constexpr const T& clamp(
const T& v,
const T& low,
const T& high)
49 return (v < low) ? low : (high < v) ? high : v;
52template <
class T,
class Compare>
53constexpr const T& clamp(
const T& v,
const T& low,
const T& high, Compare comp)
55 return comp(v, low) ? low : comp(high, v) ? high : v;
67constexpr inline typename std::underlying_type<E>::type to_underlying(
const E e)
noexcept
69 return static_cast<typename std::underlying_type<E>::type
>(e);
Top level namespace of M5.
Definition base64.cpp:39
STL compatibility functions and classes.