Export of internal Abseil changes.
-- f4bb8afa9376b4120f56f3beff7b07260da4a5c2 by CJ Johnson <johnsoncj@google.com>: Add user to Github list PiperOrigin-RevId: 209630262 GitOrigin-RevId: f4bb8afa9376b4120f56f3beff7b07260da4a5c2 Change-Id: I3fedf35011d805ee4a20b92e073b43523b47d15b
This commit is contained in:
parent
fefc83638f
commit
bed5bd6e18
54 changed files with 302 additions and 302 deletions
|
|
@ -189,7 +189,7 @@ struct DefaultFormatter<std::unique_ptr<ValueType>>
|
|||
//
|
||||
|
||||
// The main joining algorithm. This simply joins the elements in the given
|
||||
// iterator range, each separated by the given separator, into an output std::string,
|
||||
// iterator range, each separated by the given separator, into an output string,
|
||||
// and formats each element using the provided Formatter object.
|
||||
template <typename Iterator, typename Formatter>
|
||||
std::string JoinAlgorithm(Iterator start, Iterator end, absl::string_view s,
|
||||
|
|
@ -205,20 +205,20 @@ std::string JoinAlgorithm(Iterator start, Iterator end, absl::string_view s,
|
|||
}
|
||||
|
||||
// A joining algorithm that's optimized for a forward iterator range of
|
||||
// std::string-like objects that do not need any additional formatting. This is to
|
||||
// optimize the common case of joining, say, a std::vector<std::string> or a
|
||||
// string-like objects that do not need any additional formatting. This is to
|
||||
// optimize the common case of joining, say, a std::vector<string> or a
|
||||
// std::vector<absl::string_view>.
|
||||
//
|
||||
// This is an overload of the previous JoinAlgorithm() function. Here the
|
||||
// Formatter argument is of type NoFormatter. Since NoFormatter is an internal
|
||||
// type, this overload is only invoked when strings::Join() is called with a
|
||||
// range of std::string-like objects (e.g., std::string, absl::string_view), and an
|
||||
// range of string-like objects (e.g., string, absl::string_view), and an
|
||||
// explicit Formatter argument was NOT specified.
|
||||
//
|
||||
// The optimization is that the needed space will be reserved in the output
|
||||
// std::string to avoid the need to resize while appending. To do this, the iterator
|
||||
// string to avoid the need to resize while appending. To do this, the iterator
|
||||
// range will be traversed twice: once to calculate the total needed size, and
|
||||
// then again to copy the elements and delimiters to the output std::string.
|
||||
// then again to copy the elements and delimiters to the output string.
|
||||
template <typename Iterator,
|
||||
typename = typename std::enable_if<std::is_convertible<
|
||||
typename std::iterator_traits<Iterator>::iterator_category,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue