forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADT] Teach StringRef to derive from std::string_view (llvm#113752)
This patch makes minimum changes to have StringRef derive from std::string_view, with an eventual goal of removing StringRef completely. Subsequent patches will further clean up the remaining bits. I've chosen public inheritance over private one because our codebase relies on implicit conversions to std::string_view, which is currently provided by: constexpr operator std::string_view() const { return std::string_view(data(), size()); } This implicit conversion stops applying once we use std::string_view as a base class, public or private. If we chose a private base class, we would lose the implicit conversion.
- Loading branch information
1 parent
9672375
commit a3181b1
Showing
1 changed file
with
10 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters