| 1275 | |
| 1276 | template <class... TArgs> |
| 1277 | void Format(TStringBuilderBase* builder, TFormatString<TArgs...> format, TArgs&&... args) |
| 1278 | { |
| 1279 | // NB(arkady-e1ppa): "if constexpr" is done in order to prevent |
| 1280 | // compiler from emitting "No matching function to call" |
| 1281 | // when arguments are not formattable. |
| 1282 | // Compiler would crash in TFormatString ctor |
| 1283 | // anyway (e.g. program would not compile) but |
| 1284 | // for some reason it does look ahead and emits |
| 1285 | // a second error. |
| 1286 | if constexpr ((CFormattable<TArgs> && ...)) { |
| 1287 | NYT::NDetail::TValueFormatter<0, TArgs...> formatter(args...); |
| 1288 | NYT::NDetail::RunFormatter(builder, format, formatter); |
| 1289 | } |
| 1290 | } |
| 1291 | |
| 1292 | template <class... TArgs> |
| 1293 | TString Format(TFormatString<TArgs...> format, TArgs&&... args) |
no test coverage detected