diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-08-15 05:38:37 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-08-15 05:52:37 -0400 |
| commit | aaed7027903544c80df4e03f62a96ba8ffa9cf5e (patch) | |
| tree | d242adb55cd5998b6f5ee20462717d6a916bb552 /src/core/loader/loader.h | |
| parent | 26a456e76f3808f8a499c8c31052fb68f8bccf5c (diff) | |
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.
Diffstat (limited to 'src/core/loader/loader.h')
| -rw-r--r-- | src/core/loader/loader.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 6dffe451a6..b74cfbf8a8 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -5,6 +5,7 @@ #pragma once #include <algorithm> +#include <iosfwd> #include <memory> #include <string> #include <utility> @@ -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 { |
