1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

move iostream_operators to magic_enum_iostream

This commit is contained in:
neargye 2023-05-21 17:49:46 +04:00
parent 57d7e79530
commit ed43fd5fa2
8 changed files with 148 additions and 87 deletions

View file

@ -23,6 +23,7 @@
#include <iostream>
#include <magic_enum.hpp>
#include <magic_enum_iostream.hpp>
enum class Color : int { RED = -10, BLUE = 0, GREEN = 10 };
@ -80,7 +81,7 @@ int main() {
std::cout << " " << c; // Ostream operator for enum.
}
std::cout << std::endl;
// Color sequence: RED BLUE GREEN
// Color values: RED BLUE GREEN
enum class Flags { A = 1, B = 2, C = 4, D = 8 };
using namespace magic_enum::bitwise_operators; // out-of-the-box bitwise operators for all enums.