absl::StrJoin

StrJoin overloads

Synopses

Declared in <absl/strings/str_join.h>

Joins an initializer list of string_view using the default formatter.

std::string
StrJoin(
    std::initializer_list<std::string_view> il,
    std::string_view separator);
» more...

Joins the elements of an initializer list using the default formatter.

template<typename T>
requires !std::is_convertible_v<T, absl::string_view>
std::string
StrJoin(
    std::initializer_list<T> il,
    std::string_view separator);
» more...

Joins the elements of a range using the default formatter.

template<typename Range>
std::string
StrJoin(
    Range const& range,
    std::string_view separator);
» more...

Joins the elements of a std::tuple using the default formatter.

template<typename... T>
std::string
StrJoin(
    std::tuple<T...> const& value,
    std::string_view separator);
» more...

Joins a range of elements using the default formatter.

template<typename Iterator>
std::string
StrJoin(
    Iterator start,
    Iterator end,
    std::string_view separator);
» more...

Joins an initializer list of string_view using a custom formatter.

template<typename Formatter>
std::string
StrJoin(
    std::initializer_list<std::string_view> il,
    std::string_view separator,
    Formatter&& fmt);
» more...

Joins the elements of an initializer list using a custom formatter.

template<
    typename T,
    typename Formatter>
requires !std::is_convertible_v<T, absl::string_view>
std::string
StrJoin(
    std::initializer_list<T> il,
    std::string_view separator,
    Formatter&& fmt);
» more...

Joins the elements of a range using a custom formatter.

template<
    typename Range,
    typename Formatter>
std::string
StrJoin(
    Range const& range,
    std::string_view separator,
    Formatter&& fmt);
» more...

Joins the elements of a std::tuple using a custom formatter.

template<
    typename... T,
    typename Formatter>
std::string
StrJoin(
    std::tuple<T...> const& value,
    std::string_view separator,
    Formatter&& fmt);
» more...

Joins a range of elements and returns the result as a std::string.

template<
    typename Iterator,
    typename Formatter>
std::string
StrJoin(
    Iterator start,
    Iterator end,
    std::string_view sep,
    Formatter&& fmt);
» more...

Return Value

The joined string.

Parameters

NameDescription
ilThe initializer list of elements to join.
separatorThe separator placed between joined elements.
rangeThe range of elements to join.
valueThe tuple of elements to join.
startIterator to the first element to join.
endIterator past the last element to join.
fmtThe formatter used to convert each element to a string.
sepThe separator placed between joined elements.