This commit is contained in:
jeanlemotan
2024-07-02 18:06:33 +02:00
commit 8297b0b45f
157 changed files with 24865 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include "tl/detail/prologue.h"
#include <EASTL/optional.h>
#include <format>
namespace tl
{
using namespace eastl;
}
template<typename T>
struct std::formatter<tl::optional<T>>
{
constexpr auto parse(format_parse_context& ctx) noexcept { return ctx.begin(); }
auto format(const tl::optional<T>& s, std::format_context& ctx) const
{
if (s.has_value())
return format_to(ctx.out(), "{}", s.value());
return format_to(ctx.out(), "<null>");
}
};