MySQL 9.1.0
Source Code Documentation
flags.h File Reference
#include <bit>
#include <type_traits>
#include "mysql/harness/stdx/type_traits.h"

Go to the source code of this file.

Classes

struct  stdx::is_flags< E, Enabler >
 
class  stdx::flags< E >
 a type-safe flags type. More...
 

Namespaces

namespace  stdx
 

Functions

template<class E >
constexpr auto operator| (E e1, E e2) noexcept -> std::enable_if_t< stdx::is_flags< E >::value, stdx::flags< E > >
 bit-or. More...
 
template<class E >
constexpr auto operator& (E e1, E e2) noexcept -> std::enable_if_t< stdx::is_flags< E >::value, stdx::flags< E > >
 bit-and. More...
 
template<class E >
constexpr auto operator^ (E e1, E e2) noexcept -> std::enable_if_t< stdx::is_flags< E >::value, stdx::flags< E > >
 bit-xor. More...
 

Variables

template<class E >
constexpr bool stdx::is_flags_v = is_flags<E>::value
 

Function Documentation

◆ operator&()

template<class E >
constexpr auto operator& ( e1,
e2 
) -> std::enable_if_t<stdx::is_flags<E>::value, stdx::flags<E>>
constexprnoexcept

bit-and.

E & E -> flags<E>;

Returns
a flags<E> of bit-and(e1, e2).

◆ operator^()

template<class E >
constexpr auto operator^ ( e1,
e2 
) -> std::enable_if_t<stdx::is_flags<E>::value, stdx::flags<E>>
constexprnoexcept

bit-xor.

E ^ E -> flags<E>;

Returns
a flags<E> of bit-xor(e1, e2).

◆ operator|()

template<class E >
constexpr auto operator| ( e1,
e2 
) -> std::enable_if_t<stdx::is_flags<E>::value, stdx::flags<E>>
constexprnoexcept

bit-or.

E | E -> flags<E>;

Returns
a flags<E> of bit-or(e1, e2).