Files
2025-10-25 03:02:53 +03:00

1.3 KiB
Raw Permalink Blame History

[range.join.with.overview]

25 Ranges library [ranges]

25.7 Range adaptors [range.adaptors]

25.7.15 Join with view [range.join.with]

25.7.15.1 Overview [range.join.with.overview]

1

#

join_with_view takes a view and a delimiter, and flattens the view, inserting every element of the delimiter in between elements of the view.

The delimiter can be a single element or a view of elements.

2

#

The name views::join_with denotes a range adaptor object ([range.adaptor.object]).

Given subexpressions E and F, the expression views::join_with(E, F) is expression-equivalent tojoin_with_view(E, F).

3

#

[Example 1: vector vs = {"the", "quick", "brown", "fox"};for (char c : vs | views::join_with('-')) { cout << c;}// The above prints the-quick-brown-fox — end example]