| 113 | namespace NPrivate { |
| 114 | template <typename TCharType, typename TIter> |
| 115 | inline TBasicString<TCharType> JoinRange(TBasicStringBuf<TCharType> delim, const TIter beg, const TIter end) { |
| 116 | TBasicString<TCharType> out; |
| 117 | if (beg != end) { |
| 118 | size_t total = ::NPrivate::GetLength(*beg); |
| 119 | for (TIter pos = beg; ++pos != end;) { |
| 120 | total += delim.length() + ::NPrivate::GetLength(*pos); |
| 121 | } |
| 122 | if (total > 0) { |
| 123 | out.reserve(total); |
| 124 | } |
| 125 | |
| 126 | AppendToString(out, *beg); |
| 127 | for (TIter pos = beg; ++pos != end;) { |
| 128 | AppendJoinNoReserve(out, delim, *pos); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | return out; |
| 133 | } |
| 134 | |
| 135 | } // namespace NPrivate |
| 136 |
no test coverage detected