Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- #include <set>
- using namespace std;
- template <typename it>
- void PrintRange(it begin, it end){
- for(auto iterator = begin; begin!=end; ++iterator, ++begin){
- cout << *iterator << " ";
- }
- cout << endl;
- }
- int main() {
- cout << "Test1"s << endl;
- set<int> test1 = {1, 1, 1, 2, 3, 4, 5, 5};
- PrintRange(test1.begin(), test1.end());
- cout << "Test2"s << endl;
- vector<int> test2 = {}; // пустой контейнер
- PrintRange(test2.begin(), test2.end());
- cout << "End of tests"s << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement