[all-commits] [llvm/llvm-project] d6d30d: [ADT] add StringViewExtras llvm::starts_with for s...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Fri Apr 14 13:47:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d6d30dd9590b41fbcdc88b43767b27a31bfb1c73
      https://github.com/llvm/llvm-project/commit/d6d30dd9590b41fbcdc88b43767b27a31bfb1c73
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    A llvm/include/llvm/ADT/StringViewExtras.h
    M llvm/unittests/ADT/CMakeLists.txt
    A llvm/unittests/ADT/StringViewExtrasTest.cpp

  Log Message:
  -----------
  [ADT] add StringViewExtras llvm::starts_with for std::string_view

std::string_view::starts_with isn't available until C++20. Create
llvm::starts_with for now; we can delete this when LLVM moves to C++20
one day.

To run the newly added unit test:
$ cd llvm/build; ninja ADTTests; cd -
$ ./llvm/build/unittests/ADT/ADTTests --gtest_filter=StringViewExtrasTest.\*

Reviewed By: MaskRay, erichkeane

Differential Revision: https://reviews.llvm.org/D148367




More information about the All-commits mailing list