abseil / abseil/abseil-cpp

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

オープン
#1,041 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
C++
スター
18.1k
フォーク
3.2k
平均マージ
20時間 36分
マージ済み PR(30日)
1

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。