MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bitmask_operations.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <mbgl/util/traits.hpp>
4 #include <mbgl/util/util.hpp>
5 
6 namespace mbgl {
7 
8 template<typename Enum>
10  static_assert(std::is_enum<Enum>::value, "Enum must be an enum type");
12 }
13 
14 template<typename Enum>
16  static_assert(std::is_enum<Enum>::value, "Enum must be an enum type");
17  return (a = a | b);
18 }
19 
20 template<typename Enum>
22  static_assert(std::is_enum<Enum>::value, "Enum must be an enum type");
23  return bool(mbgl::underlying_type(a) & mbgl::underlying_type(b));
24 }
25 
26 template<typename Enum>
28  static_assert(std::is_enum<Enum>::value, "Enum must be an enum type");
29  return Enum(~mbgl::underlying_type(value));
30 }
31 
32 
33 } // namespace mbgl
Definition: actor.hpp:15
MBGL_CONSTEXPR bool operator&(MapDebugOptions lhs, MapDebugOptions rhs)
Definition: mode.hpp:56
MBGL_CONSTEXPR MapDebugOptions & operator|=(MapDebugOptions &lhs, MapDebugOptions rhs)
Definition: mode.hpp:52
MBGL_CONSTEXPR MapDebugOptions operator|(MapDebugOptions lhs, MapDebugOptions rhs)
Definition: mode.hpp:48
MBGL_CONSTEXPR MapDebugOptions operator~(MapDebugOptions value)
Definition: mode.hpp:64
constexpr auto underlying_type(T t) -> typename std::underlying_type_t< T >
Definition: traits.hpp:11
#define MBGL_CONSTEXPR
Definition: util.hpp:18