CppCommon  1.0.4.1
C++ Common Library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
flags.inl
Go to the documentation of this file.
1 
9 namespace CppCommon {
10 
11 template <typename TEnum>
12 inline void swap(Flags<TEnum>& flags1, Flags<TEnum>& flags2) noexcept
13 {
14  flags1.swap(flags2);
15 }
16 
17 template <typename TEnum>
18 constexpr auto operator&(TEnum value1, TEnum value2) noexcept -> typename std::enable_if<IsEnumFlags<TEnum>::value, Flags<TEnum>>::type
19 {
20  return Flags<TEnum>(value1) & value2;
21 }
22 
23 template <typename TEnum>
24 constexpr auto operator|(TEnum value1, TEnum value2) noexcept -> typename std::enable_if<IsEnumFlags<TEnum>::value, Flags<TEnum>>::type
25 {
26  return Flags<TEnum>(value1) | value2;
27 }
28 
29 template <typename TEnum>
30 constexpr auto operator^(TEnum value1, TEnum value2) noexcept -> typename std::enable_if<IsEnumFlags<TEnum>::value, Flags<TEnum>>::type
31 {
32  return Flags<TEnum>(value1) ^ value2;
33 }
34 
35 } // namespace CppCommon
Enum-based flags.
Definition: flags.h:65
C++ Common project definitions.
Definition: token_bucket.h:15
constexpr auto operator|(TEnum value1, TEnum value2) noexcept -> typename std::enable_if< IsEnumFlags< TEnum >::value, Flags< TEnum >>::type
Definition: flags.inl:24
void swap(FileCache &cache1, FileCache &cache2) noexcept
Definition: filecache.inl:23
constexpr auto operator^(TEnum value1, TEnum value2) noexcept -> typename std::enable_if< IsEnumFlags< TEnum >::value, Flags< TEnum >>::type
Definition: flags.inl:30
constexpr auto operator&(TEnum value1, TEnum value2) noexcept -> typename std::enable_if< IsEnumFlags< TEnum >::value, Flags< TEnum >>::type
Definition: flags.inl:18