Inserting an Iterator Range into a Set

Правка en7, от Asliddin2010, 2024-12-16 13:26:24

// C++ program to insert elements in set using iterator range

include <bits/stdc++.h>
using namespace std;

int main(){
vector v{ 10, 20, 30 };
set s;
s.insert(v.begin(), v.end());

for (int x : s) {
    cout << x << " ";
}
// Output: 10 20 30

return 0;

}

Теги set, insert, interator range

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en10 Английский Asliddin2010 2024-12-16 13:31:04 0 (published)
en9 Английский Asliddin2010 2024-12-16 13:30:50 1019
en8 Английский Asliddin2010 2024-12-16 13:29:27 3711 For those who didn't know, if you know, just a revision :)
en7 Английский Asliddin2010 2024-12-16 13:26:24 2498
en6 Английский Asliddin2010 2024-12-16 13:25:41 461
en5 Английский Asliddin2010 2024-12-16 13:24:48 1942
en4 Английский Asliddin2010 2024-12-16 13:23:19 4 Tiny change: 'or Range\ninclude ' -> 'or Range\n\n\ninclude '
en3 Английский Asliddin2010 2024-12-16 13:22:03 17
en2 Английский Asliddin2010 2024-12-16 13:18:58 41 For those who didn't know, if you know, just a revision :)
en1 Английский Asliddin2010 2024-12-16 13:16:21 463 For those who didn't know, if you know, just a revision :) (saved to drafts)