summaryrefslogtreecommitdiff
path: root/lib/stream_support.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stream_support.hpp')
-rw-r--r--lib/stream_support.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/stream_support.hpp b/lib/stream_support.hpp
index 5238234..2ab2f9d 100644
--- a/lib/stream_support.hpp
+++ b/lib/stream_support.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "enumDetails.hpp"
#include <glm/glm.hpp>
#include <iostream>
#include <maths.h>
@@ -51,6 +52,16 @@ namespace std {
{
return s << arc.first << " ↺ " << arc.second;
}
+
+ template<typename E>
+ concept IsEnum = std::is_enum_v<E>;
+
+ template<IsEnum E>
+ inline std::ostream &
+ operator<<(std::ostream & s, const E & e)
+ {
+ return s << EnumTypeDetails<E>::typeName << "::" << EnumDetails<E>::to_string(e).value();
+ }
}
template<typename T>