#ifndef FORMAT_STRING_INL_H_ #error "Direct inclusion of this file is not allowed, include format_string.h" // For the sake of sane code completion. #include "format_string.h" #endif namespace NYT { //////////////////////////////////////////////////////////////////////////////// template template requires std::constructible_from consteval TBasicStaticFormat::TBasicStaticFormat(const T& fmt) : Format_(fmt) { CheckFormattability(); #if !defined(NDEBUG) && !defined(YT_DISABLE_FORMAT_STATIC_ANALYSIS) NDetail::TFormatAnalyser::ValidateFormat...>(Format_); #endif } template TStringBuf TBasicStaticFormat::Get() const noexcept { return {Format_}; } template consteval void TBasicStaticFormat::CheckFormattability() { #if !defined(NDEBUG) && !defined(YT_DISABLE_FORMAT_STATIC_ANALYSIS) using TTuple = std::tuple...>; [] (std::index_sequence) { ([] { if constexpr (!CFormattable>) { CrashCompilerClassIsNotFormattable>(); } } (), ...); } (std::index_sequence_for()); #endif } inline TRuntimeFormat::TRuntimeFormat(TStringBuf fmt) : Format_(fmt) { } inline TStringBuf TRuntimeFormat::Get() const noexcept { return Format_; } //////////////////////////////////////////////////////////////////////////////// } // namespace NYT