distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
TypeFromSize.hpp File Reference

TypeFromSize type alias template header. More...

#include <type_traits>
#include <cstddef>
#include <cstdint>
Include dependency graph for TypeFromSize.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  estd::internal::TypeFromSize< size >
 Implementation of TypeFromSize. More...


 Collection of useful templates.
 Internals of estd namespace - should not be used directly!


#define STATIC_ASSERT(...)   static_assert(__VA_ARGS__, #__VA_ARGS__)
 Produces a static_assert() where the expression is also used as the message. More...


template<size_t size>
using estd::TypeFromSize = typename internal::TypeFromSize< size >::Type
 Selects fixed width type from requested byte size. More...


 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 0 >, uint8_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 1 >, uint8_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 2 >, uint16_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 3 >, uint32_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 4 >, uint32_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 5 >, uint64_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 6 >, uint64_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 7 >, uint64_t >::value==true)
 estd::STATIC_ASSERT (std::is_same< TypeFromSize< 8 >, uint64_t >::value==true)

Detailed Description

TypeFromSize type alias template header.

Copyright (C) 2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Macro Definition Documentation


#define STATIC_ASSERT (   ...)    static_assert(__VA_ARGS__, #__VA_ARGS__)

Produces a static_assert() where the expression is also used as the message.

[in]<strong>VA_ARGS</strong>is the expression that will be tested, which will also be used as the message