From 87d8a9c98626be491e87e4b9fad84b862d8aa0c9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 15 Aug 2018 05:38:37 -0400 Subject: loader: Make ResultStatus directly compatible with fmt We can make the enum class type compatible with fmt by providing an overload of operator<<. While we're at it, perform proper bounds checking. If something exceeds the array, it should be a hard fail, because it's, without a doubt, a programmer error in this case. --- src/core/loader/loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/loader/loader.h') diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 6dffe451a..b74cfbf8a 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include #include @@ -94,8 +95,7 @@ enum class ResultStatus : u16 { ErrorNoControl, }; -std::string GetMessageForResultStatus(ResultStatus status); -std::string GetMessageForResultStatus(u16 status); +std::ostream& operator<<(std::ostream& os, ResultStatus status); /// Interface for loading an application class AppLoader : NonCopyable { -- cgit v1.2.3