abseil / abseil/abseil-cpp

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

Open
#1,041 5 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
18.1k
Forks
3.2k
Avg merge
20h 36m
Merged PRs (30d)
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`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.