Files
clice/include/Support/Format.h
2024-11-19 21:43:49 +08:00

19 lines
504 B
C++

#pragma once
#include <format>
#include "llvm/ADT/StringRef.h"
template <>
struct std::formatter<llvm::StringRef> : std::formatter<std::string_view> {
template <typename ParseContext>
constexpr auto parse(ParseContext& ctx) {
return std::formatter<std::string_view>::parse(ctx);
}
template <typename FormatContext>
auto format(llvm::StringRef s, FormatContext& ctx) const {
return std::formatter<std::string_view>::format(std::string_view(s.str()), ctx);
}
};