Skip to content

Instantly share code, notes, and snippets.

@phniix
phniix / atomic_enum.h
Last active December 30, 2017 05:04
A thread safe Atomic Enumeration Type building block. Uses SFINAE to enable the only valid constructor with reasoning to prevent users from shooting themselves in the foot. Many IDEs will signal that something is not quite right if incorrect usage is attempted.
#pragma once
///
/// \file atomic_enum.h
///
/// \brief An Atomic Enum object type
///
///
#include <atomic>
#include <type_traits>