31 #ifndef ABSL_STRINGS_INTERNAL_STR_JOIN_INTERNAL_H_ 32 #define ABSL_STRINGS_INTERNAL_STR_JOIN_INTERNAL_H_ 38 #include <type_traits> 46 namespace strings_internal {
95 std::unique_ptr<strings_internal::OStringStream>
strm_;
100 template <
typename F1,
typename F2>
106 template <
typename T>
113 template <
typename T>
129 template <
typename Formatter>
136 template <
typename T>
141 template <
typename T>
157 template <
typename ValueType>
177 template <
typename ValueType>
183 template <
typename ValueType>
194 template <
typename Iterator,
typename Formatter>
199 for (Iterator it = start; it !=
end; ++it) {
200 result.append(sep.
data(), sep.
size());
222 template <
typename Iterator,
223 typename =
typename std::enable_if<std::is_convertible<
224 typename std::iterator_traits<Iterator>::iterator_category,
225 std::forward_iterator_tag>
::value>::type>
231 size_t result_size = start->size();
232 for (Iterator it = start; ++it !=
end;) {
233 result_size += s.
size();
234 result_size += it->size();
237 if (result_size > 0) {
241 char* result_buf = &*result.begin();
242 memcpy(result_buf, start->data(), start->size());
243 result_buf += start->size();
244 for (Iterator it = start; ++it !=
end;) {
245 memcpy(result_buf, s.
data(), s.
size());
246 result_buf += s.
size();
247 memcpy(result_buf, it->data(), it->size());
248 result_buf += it->size();
261 template <
size_t I,
size_t N>
263 template <
typename Tup,
typename Formatter>
266 if (I > 0) out->append(sep.
data(), sep.
size());
267 fmt(out, std::get<I>(tup));
273 template <
typename Tup,
typename Formatter>
277 template <
typename... T,
typename Formatter>
285 template <
typename Iterator>
294 template <
typename Range,
typename Formatter>
302 template <
typename Range>
312 #endif // ABSL_STRINGS_INTERNAL_STR_JOIN_INTERNAL_H_
void StrAppend(std::string *dest, const AlphaNum &a)
constexpr T && forward(absl::remove_reference_t< T > &t) noexcept
void operator()(std::string *out, const Tup &tup, absl::string_view sep, Formatter &&fmt)
std::string JoinRange(Iterator first, Iterator last, absl::string_view separator)
constexpr size_type size() const noexcept
std::string JoinAlgorithm(Iterator start, Iterator end, absl::string_view s, Formatter &&f)
void STLStringResizeUninitialized(string_type *s, size_t new_size)
constexpr const_pointer data() const noexcept
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
void operator()(std::string *, const Tup &, absl::string_view, Formatter &&)