distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
Header with templated bitwise operators for enum class flags. More...
#include <type_traits>
Go to the source code of this file.
Classes | |
struct | estd::isEnumClassFlags< T > |
Tag struct used to enable bitwise operators for selected enum class flags. More... | |
Namespaces | |
estd | |
Collection of useful templates. | |
Functions | |
template<typename T > | |
constexpr std::enable_if< estd::isEnumClassFlags< T >{}, T >::type | operator & (const T &left, const T &right) |
Bitwise AND operator. More... | |
template<typename T > | |
constexpr std::enable_if< estd::isEnumClassFlags< T >{}, T >::type | operator| (const T &left, const T &right) |
Bitwise OR operator. More... | |
template<typename T > | |
constexpr std::enable_if< estd::isEnumClassFlags< T >{}, T >::type | operator^ (const T &left, const T &right) |
Bitwise XOR operator. More... | |
template<typename T > | |
constexpr std::enable_if< estd::isEnumClassFlags< T >{}, T >::type | operator~ (const T &object) |
Bitwise NOT operator. More... | |
template<typename T > | |
constexpr std::enable_if< estd::isEnumClassFlags< T >{}, T & >::type | operator&= (T &left, const T &right) |
Bitwise AND assignment operator. More... | |
template<typename T > | |
constexpr std::enable_if< estd::isEnumClassFlags< T >{}, T & >::type | operator|= (T &left, const T &right) |
Bitwise OR assignment operator. More... | |
template<typename T > | |
constexpr std::enable_if< estd::isEnumClassFlags< T >{}, T & >::type | operator^= (T &left, const T &right) |
Bitwise XOR assignment operator. More... | |
Header with templated bitwise operators for enum class flags.
Implementation based on Using Enum Classes as Bitfields
constexpr std::enable_if<estd::isEnumClassFlags<T>{}, T>::type operator & | ( | const T & | left, |
const T & | right | ||
) |
Bitwise AND operator.
T | is the type of enum class flags for which there exists a specialization of estd::isEnumClassFlags which inherits from std::true_type |
[in] | left | is the object on the left-hand side of operator |
[in] | right | is the object on the right-hand side of operator |
constexpr std::enable_if<estd::isEnumClassFlags<T>{}, T&>::type operator&= | ( | T & | left, |
const T & | right | ||
) |
Bitwise AND assignment operator.
T | is the type of enum class flags for which there exists a specialization of estd::isEnumClassFlags which inherits from std::true_type |
[in] | left | is the object on the left-hand side of operator |
[in] | right | is the object on the right-hand side of operator |
constexpr std::enable_if<estd::isEnumClassFlags<T>{}, T>::type operator^ | ( | const T & | left, |
const T & | right | ||
) |
Bitwise XOR operator.
T | is the type of enum class flags for which there exists a specialization of estd::isEnumClassFlags which inherits from std::true_type |
[in] | left | is the object on the left-hand side of operator |
[in] | right | is the object on the right-hand side of operator |
constexpr std::enable_if<estd::isEnumClassFlags<T>{}, T&>::type operator^= | ( | T & | left, |
const T & | right | ||
) |
Bitwise XOR assignment operator.
T | is the type of enum class flags for which there exists a specialization of estd::isEnumClassFlags which inherits from std::true_type |
[in] | left | is the object on the left-hand side of operator |
[in] | right | is the object on the right-hand side of operator |
constexpr std::enable_if<estd::isEnumClassFlags<T>{}, T>::type operator| | ( | const T & | left, |
const T & | right | ||
) |
Bitwise OR operator.
T | is the type of enum class flags for which there exists a specialization of estd::isEnumClassFlags which inherits from std::true_type |
[in] | left | is the object on the left-hand side of operator |
[in] | right | is the object on the right-hand side of operator |
constexpr std::enable_if<estd::isEnumClassFlags<T>{}, T&>::type operator|= | ( | T & | left, |
const T & | right | ||
) |
Bitwise OR assignment operator.
T | is the type of enum class flags for which there exists a specialization of estd::isEnumClassFlags which inherits from std::true_type |
[in] | left | is the object on the left-hand side of operator |
[in] | right | is the object on the right-hand side of operator |
constexpr std::enable_if<estd::isEnumClassFlags<T>{}, T>::type operator~ | ( | const T & | object | ) |
Bitwise NOT operator.
T | is the type of enum class flags for which there exists a specialization of estd::isEnumClassFlags which inherits from std::true_type |
[in] | object | is the object on which the operator will act |