[ADT] Add StringRef::{starts,ends}_with(char) (#90311)
commit9bb84cec1b5375c24e5fa9cf7700070d9d1b4184
authorKazu Hirata <kazu@google.com>
Sat, 27 Apr 2024 07:37:06 +0000 (27 00:37 -0700)
committerGitHub <noreply@github.com>
Sat, 27 Apr 2024 07:37:06 +0000 (27 00:37 -0700)
tree6f0b933b5fc66b69f4f6f3ee6dd60789472db082
parent7aa6896dd7bcdcb1d09f4f98e356c43d723d9d6b
[ADT] Add StringRef::{starts,ends}_with(char) (#90311)

This patch adds to StringRef the equivalent of
std::string_view::{starts,ends}_with(char) in C++20.
llvm/include/llvm/ADT/StringRef.h
llvm/unittests/ADT/StringRefTest.cpp