فهرست منبع

reference enum to string correct implementation.

Sam Jaffe 6 سال پیش
والد
کامیت
7d5cf07eae
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      graphics/include/game/graphics/exception.h

+ 3 - 0
graphics/include/game/graphics/exception.h

@@ -26,6 +26,9 @@ namespace graphics {
   };
 
   template <typename E> struct unmapped_enum : std::logic_error {
+    // TODO (sjaffe): This is just an int cast, which isn't all that helpful.
+    // Instead, one might use  https://github.com/Neargye/magic_enum
+    // or wait for C++ to implement that sort of thing through metaclasses, etc.
     unmapped_enum(E en)
         : std::logic_error("Unknown " + type_name + std::to_string((int)en)) {}
     unmapped_enum(std::string const & str)