llvm.org GIT mirror llvm / 700f6ad
[ADT] Add a version of llvm::join() that takes a range. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298427 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 3 years ago
2 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
233233 return detail::join_impl(Begin, End, Separator, tag());
234234 }
235235
236 /// Joins the strings in the range [R.begin(), R.end()), adding Separator
237 /// between the elements.
238 template
239 inline std::string join(Range &&R, StringRef Separator) {
240 return join(R.begin(), R.end(), Separator);
241 }
242
236243 /// Joins the strings in the parameter pack \p Items, adding \p Separator
237244 /// between the elements. All arguments must be implicitly convertible to
238245 /// std::string, or there should be an overload of std::string::operator+=()
898898 EXPECT_TRUE(v2_join2);
899899 bool v2_join3 = join(v2.begin(), v2.end(), "::") == join_result3;
900900 EXPECT_TRUE(v2_join3);
901 v2_join3 = join(v2, "::") == join_result3;
902 EXPECT_TRUE(v2_join3);
901903 }
902904
903905