Enable bitwise operators on scoped enums.

cpp17-enum-flag

Enable bitwise operators on scoped enums.

Library compiles with no warnings (-std=c++17 -Wall -Wshadow -Wextra -Wnon-virtual-dtor -pedantic) on Clang 14.

Example usage

enum class TestEnum
{
    Baz = 1 << 0,
    Fou = 1 << 1,
    Moo = 1 << 2,
    Foo = 1 << 3,
    Bar = 1 << 4,
};

template <>
struct zsl::EnumFlags<TestEnum>
{
    static constexpr bool is_flags = true;
};

// ...

auto main() -> int
{
    TestEnum e{TestEnum::Baz};
    auto b = zsl::EnumIsSet(e & TestEnum::Baz);
    std::cout << (b ? "true" : "false");
    
    e = TestEnum::Foo | TestEnum::Baz;
    return 0;
}
Owner
iFarbod
Game developer. Software engineer. Perfectionist. Trying my best to get things done.
iFarbod
Similar Resources

A Beacon Object File (BOF) for Cobalt Strike which uses direct system calls to enable WDigest credential caching.

A Beacon Object File (BOF) for Cobalt Strike which uses direct system calls to enable WDigest credential caching.

WdToggle A Proof of Concept Cobalt Strike Beacon Object File which uses direct system calls to enable WDigest credential caching and circumvent Creden

Jun 16, 2022

TensorVox is an application designed to enable user-friendly and lightweight neural speech synthesis in the desktop

TensorVox is an application designed to enable user-friendly and lightweight neural speech synthesis in the desktop

TensorVox is an application designed to enable user-friendly and lightweight neural speech synthesis in the desktop, aimed at increasing accessibility to such technology.

May 17, 2022

Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡

pico-lorawan Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board using a Semtech SX1276 radio module. Based on the Semte

Jun 11, 2022

Enable eGFX for Thunderbolt Macs with SIP, ART & FileVault support.

Kryptonite enables external GPUs on Macs using Thunderbolt 1 and 2 without compromising on Mac security features such as System Integrity Protection, FileVault, and Authenticated-Root.

Jun 24, 2022

Inter-process communication library to enable allocation between processes/threads and send/receive of allocated regions between producers/consumer processes or threads using this ipc buffer.

This is a relatively simple IPC buffer that allows multiple processes and threads to share a dynamic heap allocator, designate "channels" between processes, and share that memory between producer/consumer pairs on those channels.

May 24, 2022

To recreate the board game Scotland yard and enable a single player to play the game by letting one of the roles being played by the computer based on written algorithm

To recreate the board game Scotland yard and  enable a single player to play the game by letting one of the roles being played by the computer based on written algorithm

Scotland Yard GAME OF SCOTLAND YARD This is a custom version of the classic board game, Scotland Yard .The game uses the London map used in the origin

Nov 11, 2021

IDA plugin to enable nanoMIPS processor support.

IDA plugin to enable nanoMIPS processor support.

nmips IDA plugin to enable nanoMIPS processor support. This is not limited to simple disassembly, but fully supports decompilation and even fixes up t

May 6, 2022

Recode the printf function. This project is of moderate difficulty. It will enable you to discover variadic functions in C.

100/100 🚀 Introduction to ft_printf This is the third project in the 42 Cadet Curriculum. This project is pretty straight forward, recode the printf

Apr 5, 2022

Utility to enable workspace switching with touchpad gestures in Sway.

sway-gest [WIP - Not in usable state yet] Utility to enable workspace switching with touchpad gestures in Sway. Touchpad gestures are supposed to be i

Dec 23, 2021

Project to enable using CMake from a Maven build.

CMake-Maven-Project Introduction A Maven project for the CMake build system. It can be used by including it as a plugin within your Maven project's po

May 27, 2022

CMake module to enable code coverage easily and generate coverage reports with CMake targets.

CMake-codecov CMake module to enable code coverage easily and generate coverage reports with CMake targets. Include into your project To use Findcodec

Jun 1, 2022

Enable RDP and set firewall by Windows API.

Enable RDP and set firewall by Windows API.

fast-enable-rdp This toool Enable RDP and set firewall by Windows API. How to use? enablerdp.exe -- this help enablerdp.exe any --

May 30, 2022

An app to enable fluent, cross-language video chat.

project_vouvos A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Jun 1, 2022
Related tags
Generate code for pretty-printing C++ enums

enums Generate code for pretty-printing C++ enums. Supported platforms Only Linux x86/x86_64 systems are supported. For the missing platforms, the too

Jan 31, 2022
Matryoshka loader is a tool that red team operators can leverage to generate shellcode for Microsoft Office document phishing payloads.

Overview Matryoshka loader is a tool that red team operators can leverage to generate shellcode for an egghunter to bypass size-limitations and perfor

Apr 25, 2022
(R) Efficient methods and operators for the sparse matrix classes in 'Matrix' (esp. CSR format or "RsparseMatrix")

MatrixExtra MatrixExtra is an R package which extends the sparse matrix and sparse vector types in the Matrix package, particularly the CSR or Rsparse

Jan 5, 2022
C++ Matrix -- High performance and accurate (e.g. edge cases) matrix math library with expression template arithmetic operators
C++ Matrix -- High performance and accurate (e.g. edge cases) matrix math library with expression template arithmetic operators

Matrix This is a math and arithmetic matrix library. It has stood many years of performing in mission critical production for financial systems. It ha

Jun 5, 2022
Use morphological and filter operators to inpaint (complete) a depth image
Use morphological and filter operators to inpaint (complete) a depth image

深度图补全 一、运行环境与依赖 运行环境 WINDOWS、UBUNTU 依赖 OpenCV 二、使用方法 git clone [email protected]:GCaptainNemo/depth-image-completion.git cd depth-image-completion && mkd

Jan 22, 2022
The RaftLib C++ library, streaming/dataflow concurrency via C++ iostream-like operators

RaftLib is a C++ Library for enabling stream/data-flow parallel computation. Using simple right shift operators (just like the C++ streams that you wo

Jun 16, 2022
tonemapper — A tool for exploring and applying various tonemapping operators
 tonemapper — A tool for exploring and applying various tonemapping operators

tonemapper — A tool for exploring and applying various tonemapping operators. Description Tonemapper is a an application to compare and apply various

Jun 11, 2022
[WIP] A Riru module tries to enable Magisk hide for isolated processes.

Riru-IsolatedMagiskHider Background Many applications now detect Magisk for security, Magisk provided "Magisk Hide" to prevent detection, but isolated

Jun 23, 2022