/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
library/cpp/yt/string/format_analyser.h
47 строк
1 KB
Anton Myagkov
Update ydb version to 24.4 (#4579)
07 фев 2026, 11:59
Не верифицирован
07 фев 2026, 11:59
2c21cae
Код
Авторство
О чём код?
#pragma once #include <util/generic/strbuf.h> #include <array> #include <string_view> namespace NYT::NDetail { //////////////////////////////////////////////////////////////////////////////// struct TFormatAnalyser { public: template <class... TArgs> static consteval void ValidateFormat(std::string_view fmt); private: // Non-constexpr function call will terminate compilation. // Purposefully undefined and non-constexpr/consteval template <class T> static void CrashCompilerNotFormattable(std::string_view /*msg*/) { /*Suppress "internal linkage but undefined" warning*/ } static void CrashCompilerNotEnoughArguments(std::string_view msg); static void CrashCompilerTooManyArguments(std::string_view msg); static void CrashCompilerWrongTermination(std::string_view msg); static void CrashCompilerMissingTermination(std::string_view msg); static void CrashCompilerWrongFlagSpecifier(std::string_view msg); struct TSpecifiers { std::string_view Conversion; std::string_view Flags; }; template <class TArg> static consteval auto GetSpecifiers(); static constexpr char IntroductorySymbol = '%'; }; //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NDetail #define FORMAT_ANALYSER_INL_H_ #include "format_analyser-inl.h" #undef FORMAT_ANALYSER_INL_H_