21 namespace strings_internal {
24 std::initializer_list<nonstd::string_view> pieces)
27 for (
const auto& piece: pieces)
31 dest->reserve(dest->size() + size);
32 for (
const auto& piece: pieces)
34 dest->append( piece.data(), piece.size() );
38 inline std::string
CatPieces(std::initializer_list<nonstd::string_view> pieces)
47 inline std::string
StrCat() {
return std::string(); }
49 inline std::string
StrCat(
const nonstd::string_view& a) {
50 return std::string(a.data(), a.size());
53 inline std::string
StrCat(
const nonstd::string_view& a,
54 const nonstd::string_view& b)
59 inline std::string
StrCat(
const nonstd::string_view& a,
60 const nonstd::string_view& b,
61 const nonstd::string_view& c)
67 template <
typename... AV>
68 inline std::string
StrCat(
const nonstd::string_view& a,
69 const nonstd::string_view& b,
70 const nonstd::string_view& c,
71 const nonstd::string_view& d,
81 const nonstd::string_view& a)
83 destination->append( a.data(), a.size());
87 const nonstd::string_view& a,
88 const nonstd::string_view& b)
94 const nonstd::string_view& a,
95 const nonstd::string_view& b,
96 const nonstd::string_view& c)
102 template <
typename... AV>
104 const nonstd::string_view& a,
105 const nonstd::string_view& b,
106 const nonstd::string_view& c,
107 const nonstd::string_view& d,
void AppendPieces(std::string *dest, std::initializer_list< nonstd::string_view > pieces)
std::string CatPieces(std::initializer_list< nonstd::string_view > pieces)
void StrAppend(std::string *destination, const nonstd::string_view &a)