abseil / abseil/abseil-cpp

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

Ouverte
#1,041 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
question
Langage dominant
C++
Étoiles
18.1k
Forks
3.2k
Merge moyen
20 h 36 min
PR mergées (30 j)
1

Description

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`?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.