Mir
Public Types | Public Member Functions | List of all members
mir::Flags< Enum > Struct Template Reference

#include <flags.h>

Public Types

using value_type = typename std::underlying_type< Enum >::type
 

Public Member Functions

constexpr Flags (value_type flag_value=0) noexcept
 
constexpr Flags (Enum flag_value) noexcept
 
constexpr Flags< Enum > operator| (Flags< Enum > other) const noexcept
 
constexpr Flags< Enum > operator & (Flags< Enum > other) const noexcept
 
constexpr Flags< Enum > operator^ (Flags< Enum > other) const noexcept
 
Flags< Enum > & operator|= (Flags< Enum > other) noexcept
 
Flags< Enum > operator &= (Flags< Enum > other) noexcept
 
Flags< Enum > operator^= (Flags< Enum > other) noexcept
 
constexpr bool operator== (Flags< Enum > other) const noexcept
 
constexpr bool operator!= (Flags< Enum > other) const noexcept
 
constexpr value_type value () const noexcept
 

Detailed Description

template<typename Enum>
struct mir::Flags< Enum >

Treat an enumeration, scoped and unscoped, like a set of flags.

For scoped enumerations, there are optional bitwise operators available that can be enabled by declaring a function within the namespace of the enumeration (here Enum):

Member Typedef Documentation

◆ value_type

template<typename Enum>
using mir::Flags< Enum >::value_type = typename std::underlying_type<Enum>::type

Constructor & Destructor Documentation

◆ Flags() [1/2]

template<typename Enum>
constexpr mir::Flags< Enum >::Flags ( value_type  flag_value = 0)
inlineexplicitnoexcept

◆ Flags() [2/2]

template<typename Enum>
constexpr mir::Flags< Enum >::Flags ( Enum  flag_value)
inlinenoexcept

Member Function Documentation

◆ operator &()

template<typename Enum>
constexpr Flags<Enum> mir::Flags< Enum >::operator& ( Flags< Enum >  other) const
inlinenoexcept

◆ operator &=()

template<typename Enum>
Flags<Enum> mir::Flags< Enum >::operator&= ( Flags< Enum >  other)
inlinenoexcept

◆ operator!=()

template<typename Enum>
constexpr bool mir::Flags< Enum >::operator!= ( Flags< Enum >  other) const
inlinenoexcept

◆ operator==()

template<typename Enum>
constexpr bool mir::Flags< Enum >::operator== ( Flags< Enum >  other) const
inlinenoexcept

◆ operator^()

template<typename Enum>
constexpr Flags<Enum> mir::Flags< Enum >::operator^ ( Flags< Enum >  other) const
inlinenoexcept

◆ operator^=()

template<typename Enum>
Flags<Enum> mir::Flags< Enum >::operator^= ( Flags< Enum >  other)
inlinenoexcept

◆ operator|()

template<typename Enum>
constexpr Flags<Enum> mir::Flags< Enum >::operator| ( Flags< Enum >  other) const
inlinenoexcept

◆ operator|=()

template<typename Enum>
Flags<Enum>& mir::Flags< Enum >::operator|= ( Flags< Enum >  other)
inlinenoexcept

◆ value()

template<typename Enum>
constexpr value_type mir::Flags< Enum >::value ( ) const
inlinenoexcept

The documentation for this struct was generated from the following file:

Copyright © 2012-2018 Canonical Ltd.
Generated on Mon Feb 19 14:06:43 UTC 2018