-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset.cpp
More file actions
37 lines (29 loc) · 662 Bytes
/
set.cpp
File metadata and controls
37 lines (29 loc) · 662 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
#include "set.hpp"
//////////////////////////////////////////////////////////////////////////////
int main()
{
sg::set<int> s{4, 3, 2, 1};
std::cout << s.contains(3u) << std::endl;
std::cout << s.contains(100ull) << std::endl;
std::for_each(
s.cbegin(),
s.cend(),
[](auto&& p) noexcept
{
std::cout << p << std::endl;
}
);
std::cout << "eq: " << (s == sg::set<int>{1, 2, 3, 4}) << std::endl;
s.erase(std::next(s.cbegin()));
s.erase(std::prev(s.cend()));
std::for_each(
s.cbegin(),
s.cend(),
[](auto&& p) noexcept
{
std::cout << p << std::endl;
}
);
return 0;
}