opened
hzeller
username_0
The C++17 `std::string_view` has a `constexpr substr()` : https://en.cppreference.com/w/cpp/string/basic_string_view/substr

While the absl version of `substr()` can not be used in a constexpr https://github.com/abseil/abseil-cpp/blob/0033c9ea91a52ade7c6b725aa2ef3cbe15463421/absl/strings/string_view.h#L385

This makes `absl::string_view` slightly less convenient in initializing more complex strings at compile time and requires [workarounds](https://github.com/google/verible/blob/a76f7e9030557e9b074f7303a00e3e5fbabd4f60/common/text/tree_utils_test.cc#L623).

Expectation: `substr()` would also work as constexpr.

For implementation, probably some functional implementation of the exception-throwing has to be done.
Compatibility: c++17 std::string_view::substr() is constexpr while absl::string_view::substr() is not
issue
closed
absl-federation-github
username_1
issue