Flutter Engine
The Flutter Engine
Classes | Namespaces | Functions
SkBitmaskEnum.h File Reference
#include <type_traits>

Go to the source code of this file.

Classes

struct  sknonstd::is_bitmask_enum< T >
 

Namespaces

namespace  sknonstd
 

Functions

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, bool > constexpr sknonstd::Any (E e)
 
template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator| (E l, E r)
 
template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator|= (E &l, E r)
 
template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator& (E l, E r)
 
template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator&= (E &l, E r)
 
template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator^ (E l, E r)
 
template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator^= (E &l, E r)
 
template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator~ (E e)
 

Function Documentation

◆ operator&()

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator& ( E  l,
E  r 
)
constexpr

Definition at line 33 of file SkBitmaskEnum.h.

33 {
34 using U = std::underlying_type_t<E>;
35 return static_cast<E>(static_cast<U>(l) & static_cast<U>(r));
36}

◆ operator&=()

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator&= ( E l,
E  r 
)
constexpr

Definition at line 39 of file SkBitmaskEnum.h.

39 {
40 return l = l & r;
41}

◆ operator^()

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator^ ( E  l,
E  r 
)
constexpr

Definition at line 44 of file SkBitmaskEnum.h.

44 {
45 using U = std::underlying_type_t<E>;
46 return static_cast<E>(static_cast<U>(l) ^ static_cast<U>(r));
47}

◆ operator^=()

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator^= ( E l,
E  r 
)
constexpr

Definition at line 50 of file SkBitmaskEnum.h.

50 {
51 return l = l ^ r;
52}

◆ operator|()

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator| ( E  l,
E  r 
)
constexpr

Definition at line 22 of file SkBitmaskEnum.h.

22 {
23 using U = std::underlying_type_t<E>;
24 return static_cast<E>(static_cast<U>(l) | static_cast<U>(r));
25}

◆ operator|=()

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator|= ( E l,
E  r 
)
constexpr

Definition at line 28 of file SkBitmaskEnum.h.

28 {
29 return l = l | r;
30}

◆ operator~()

template<typename E >
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator~ ( E  e)
constexpr

Definition at line 55 of file SkBitmaskEnum.h.

55 {
56 return static_cast<E>(~static_cast<std::underlying_type_t<E>>(e));
57}