[PATCH] D24880: Add StringExtras join_items function

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 20:48:02 PDT 2016


zturner added inline comments.

================
Comment at: include/llvm/ADT/StringExtras.h:222
@@ +221,3 @@
+inline std::string join_items(Sep Separator, Args &&... Items) {
+  std::string Result;
+  detail::join_items_impl(Result, Separator, std::forward<Args>(Items)...);
----------------
mehdi_amini wrote:
> Could you add a "reserve" stage here?
> 
Seems reasonable, but how big?  `(max(1, sizeof...(Items)) - 1) * Separator.size())` is a lower bound.  Should I just go with that?


https://reviews.llvm.org/D24880





More information about the llvm-commits mailing list