abseil / abseil/abseil-cpp

Why does FormatTime() use absl::string_view as "format" string instead of a constexpr?

Aperta
#1,041 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
C++
Stelle
18.1k
Fork
3.2k
Merge medio
20h 36m
PR unite (30g)
1

Descrizione

The [FormatTime()](https://github.com/abseil/abseil-cpp/blob/master/absl/time/time.h#L1307) API is:

```
std::string FormatTime(absl::string_view format, Time t, TimeZone tz);
```
The `format` argument is generally a `constexpr`, as in [StrFormat()](https://github.com/abseil/abseil-cpp/blob/master/absl/strings/str_format.h#L338)

Can anyone explain why `FormatTime()` accepts a `absl::string_view` as the `format` string instead of a `constexpr`?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.