AsmGrader 0.0.0
Loading...
Searching...
No Matches
unknown.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <fmt/base.h>
4#include <fmt/format.h>
5
6#include <string>
7
8namespace asmgrader {
9
10template <typename T>
11inline std::string fmt_or_unknown(T&& value, fmt::fstring<T> fmt = "{}") {
12 if constexpr (fmt::formattable<T>) {
13 return fmt::format(fmt, std::forward<T>(value));
14 } else {
15 return "<unknown>";
16 }
17}
18
19} // namespace asmgrader
Definition asm_buffer.hpp:19
std::string fmt_or_unknown(T &&value, fmt::fstring< T > fmt="{}")
Definition unknown.hpp:11