C++ Utilities 5.26.1
Useful C++ classes and routines such as argument parser, IO and conversion utilities
Loading...
Searching...
No Matches
flagenumclass.h File Reference
#include "./traits.h"
Include dependency graph for flagenumclass.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CppUtilities::IsFlagEnumClass< T >
 The IsFlagEnumClass class is used to decide whether to enable operations for flag enums for. More...
 

Namespaces

namespace  CppUtilities
 Contains all utilities provides by the c++utilities library.
 
namespace  CppUtilities::FlagEnumClassOperations
 The FlagEnumClassOperations namespace contains operations for flag enums.
 

Macros

#define CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(Namespace, EnumClassType)
 

Functions

template<typename FlagEnumClass , Traits::EnableIf< IsFlagEnumClass< FlagEnumClass > > * = nullptr>
constexpr FlagEnumClass CppUtilities::FlagEnumClassOperations::operator| (FlagEnumClass lhs, FlagEnumClass rhs)
 
template<typename FlagEnumClass , Traits::EnableIf< IsFlagEnumClass< FlagEnumClass > > * = nullptr>
constexpr bool CppUtilities::FlagEnumClassOperations::operator& (FlagEnumClass lhs, FlagEnumClass rhs)
 
template<typename FlagEnumClass , Traits::EnableIf< IsFlagEnumClass< FlagEnumClass > > * = nullptr>
constexpr FlagEnumClass & CppUtilities::FlagEnumClassOperations::operator|= (FlagEnumClass &lhs, FlagEnumClass rhs)
 
template<typename FlagEnumClass , Traits::EnableIf< IsFlagEnumClass< FlagEnumClass > > * = nullptr>
constexpr FlagEnumClass & CppUtilities::FlagEnumClassOperations::operator+= (FlagEnumClass &lhs, FlagEnumClass rhs)
 
template<typename FlagEnumClass , Traits::EnableIf< IsFlagEnumClass< FlagEnumClass > > * = nullptr>
constexpr FlagEnumClass & CppUtilities::FlagEnumClassOperations::operator-= (FlagEnumClass &lhs, FlagEnumClass rhs)
 
template<typename FlagEnumClass , Traits::EnableIf< IsFlagEnumClass< FlagEnumClass > > * = nullptr>
constexpr FlagEnumClass & CppUtilities::modFlagEnum (FlagEnumClass &flagVariable, FlagEnumClass relevantFlags, bool value)
 Sets the specified relevantFlags in the specified flagVariable to the specified value.
 
template<typename FlagEnumClass , Traits::EnableIf< IsFlagEnumClass< FlagEnumClass > > * = nullptr>
constexpr bool CppUtilities::checkFlagEnum (FlagEnumClass flagVariable, FlagEnumClass flagsToCheck)
 Returns whether the specified flagVariable has set all flags specified via flagsToCheck to true.
 

Macro Definition Documentation

◆ CPP_UTILITIES_MARK_FLAG_ENUM_CLASS

#define CPP_UTILITIES_MARK_FLAG_ENUM_CLASS ( Namespace,
EnumClassType )
Value:
namespace CppUtilities { \
template <> struct IsFlagEnumClass<EnumClassType> : Traits::Bool<true> { \
}; \
} \
namespace Namespace { \
using CppUtilities::FlagEnumClassOperations::operator|; \
using CppUtilities::FlagEnumClassOperations::operator&; \
using CppUtilities::FlagEnumClassOperations::operator|=; \
using CppUtilities::FlagEnumClassOperations::operator+=; \
using CppUtilities::FlagEnumClassOperations::operator-=; \
}
Contains all utilities provides by the c++utilities library.

Definition at line 18 of file flagenumclass.h.