-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolyset_test.cpp
More file actions
35 lines (33 loc) · 915 Bytes
/
polyset_test.cpp
File metadata and controls
35 lines (33 loc) · 915 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
#include "polyset.hpp"
#include <set>
#include <iostream>
#include <cstdlib>
int main(const int argc, const char** argv) {
using namespace std;
using namespace com_masaers;
polyset<double, int> ps;
{
auto p = ps.insert(double(1.5));
cout << *(const double*)p.first << " " << (p.second ? "true" : "false") << endl;
}
{
auto p = ps.insert(int(1));
cout << *(const int*)p.first << " " << (p.second ? "true" : "false") << endl;
}
{
auto p = ps.insert(int(1));
cout << *(const int*)p.first << " " << (p.second ? "true" : "false") << endl;
}
{
auto it = ps.find(int(1));
cout << *(const int*)it << endl;
}
{
auto it = ps.find(int(1));
cout << ((const int*)it != NULL ? "found!" : "missing!") << endl;
ps.erase(int(1));
auto jt = ps.find(int(1));
cout << ((const int*)jt != NULL ? "found!" : "missing!") << endl;
}
return EXIT_SUCCESS;
}