From 1f524e1a13e7f3712a8e539eaaaff71b2c0771ca Mon Sep 17 00:00:00 2001 From: "M. Galib Uludag" Date: Wed, 13 Mar 2024 06:48:07 +0200 Subject: [PATCH] Update enum_name.hpp --- include/enum_name.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/enum_name.hpp b/include/enum_name.hpp index 3fa2d66..ad15ebf 100644 --- a/include/enum_name.hpp +++ b/include/enum_name.hpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -586,4 +587,12 @@ namespace mgutility { } } // namespace mgutility +template::value, bool>::type = true> +auto operator<<(std::ostream& os, Enum e) -> std::ostream& +{ + static_assert(std::is_enum::value, "Value is not an Enum type!"); + os << mgutility::enum_name(e); + return os; +} + #endif // MGUTILITY_ENUM_NAME_HPP