[PATCH] D103935: Add Twine support for std::string_view.
Sterling Augustine via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 8 17:15:31 PDT 2021
saugustine added inline comments.
================
Comment at: llvm/lib/Support/Twine.cpp:48
+#if __cplusplus > 201402L
+ case StdStringViewKind: {
+ const std::string_view *str = LHS.stdStringView;
----------------
craig.topper wrote:
> Is string_view guaranteed to be null terminated?
A string_view is not guaranteed to be null terminated, so it includes the size field, which is filled in when the string_view at construction time, possibly by the constructor searching for a null in the string or array of characters, but perhaps just by passing in a length.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103935/new/
https://reviews.llvm.org/D103935
More information about the llvm-commits
mailing list