OSDN Git Service

Add llvm::join_items to StringExtras.
authorZachary Turner <zturner@google.com>
Tue, 27 Sep 2016 16:37:30 +0000 (16:37 +0000)
committerZachary Turner <zturner@google.com>
Tue, 27 Sep 2016 16:37:30 +0000 (16:37 +0000)
commitb93468a311e3c72cff75c6d65421fb392d231939
treea56dd8cabe98d5c50ec5cbbad8fd73cd45606ed7
parent09e2479ca3efb99dbde87831ba9f6aa7e60e4131
Add llvm::join_items to StringExtras.

llvm::join_items is similar to llvm::join, which produces a string
by concatenating a sequence of values together separated by a
given separator.  But it differs in that the arguments to
llvm::join() are same-type members of a container, whereas the
arguments to llvm::join_items are arbitrary types passed into
a variadic template.  The only requirement on parameters to
llvm::join_items (including for the separator themselves) is
that they be implicitly convertible to std::string or have
an overload of std::string::operator+

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282502 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringExtras.h
unittests/ADT/CMakeLists.txt
unittests/ADT/StringExtrasTest.cpp [new file with mode: 0644]