24 #ifdef INCLUDE_LIBCXX_UNITTESTS 29 #include <forward_list> 37 exit_handler_intel_x64::unittest_1001_containers_array()
const 39 std::array<int, 4> myarray = {{0, 1, 2, 3}};
40 std::array<int, 4> myarray2 = {{0, 1, 2, 3}};
43 for (
auto iter = myarray.begin(); iter != myarray.end(); iter++)
47 for (
auto iter = myarray.rbegin(); iter != myarray.rend(); iter++)
51 for (
auto iter = myarray.cbegin(); iter != myarray.cend(); iter++)
55 for (
auto iter = myarray.crbegin(); iter != myarray.crend(); iter++)
74 myarray.swap(myarray2);
88 exit_handler_intel_x64::unittest_1002_containers_vector()
const 90 auto myvector = std::vector<int>({0, 1, 2, 3});
91 auto myvector2 = std::vector<int>({0, 1, 2, 3});
94 for (
auto iter = myvector.begin(); iter != myvector.end(); iter++)
98 for (
auto iter = myvector.rbegin(); iter != myvector.rend(); iter++)
102 for (
auto iter = myvector.cbegin(); iter != myvector.cend(); iter++)
106 for (
auto iter = myvector.crbegin(); iter != myvector.crend(); iter++)
120 myvector.shrink_to_fit();
128 myvector.assign(4, 0);
129 myvector = myvector2;
131 myvector.push_back(4);
133 myvector = myvector2;
135 myvector.insert(myvector.begin(), 0);
136 myvector.erase(myvector.begin());
137 myvector = myvector2;
139 myvector.swap(myvector2);
142 myvector.emplace(myvector.begin());
143 myvector.emplace_back();
144 myvector = myvector2;
152 myvector = myvector2;
154 myvector.get_allocator();
159 exit_handler_intel_x64::unittest_1003_containers_deque()
const 161 std::deque<int> mydeque = {{0, 1, 2, 3}};
162 std::deque<int> mydeque2 = {{0, 1, 2, 3}};
165 for (
auto iter = mydeque.begin(); iter != mydeque.end(); iter++)
169 for (
auto iter = mydeque.rbegin(); iter != mydeque.rend(); iter++)
173 for (
auto iter = mydeque.cbegin(); iter != mydeque.cend(); iter++)
177 for (
auto iter = mydeque.crbegin(); iter != mydeque.crend(); iter++)
189 mydeque.shrink_to_fit();
196 mydeque.assign(4, 0);
199 mydeque.push_back(4);
203 mydeque.push_front(4);
207 mydeque.insert(mydeque.begin(), 0);
208 mydeque.erase(mydeque.begin());
211 mydeque.swap(mydeque2);
214 mydeque.emplace(mydeque.begin());
215 mydeque.emplace_back();
216 mydeque.emplace_front();
227 mydeque.get_allocator();
232 exit_handler_intel_x64::unittest_1004_containers_forward_list()
const 234 std::forward_list<int> mylist = {{0, 1, 2, 3}};
235 std::forward_list<int> mylist2 = {{0, 1, 2, 3}};
237 mylist.insert_after(mylist.before_begin(), 10);
238 mylist.erase_after(mylist.before_begin());
239 mylist.insert_after(mylist.cbefore_begin(), 10);
240 mylist.erase_after(mylist.cbefore_begin());
244 for (
auto iter = mylist.begin(); iter != mylist.end(); iter++)
248 for (
auto iter = mylist.cbegin(); iter != mylist.cend(); iter++)
263 mylist.push_front(4);
267 mylist.swap(mylist2);
270 mylist.emplace_front();
271 mylist.emplace_after(mylist.begin());
282 mylist.splice_after(mylist.before_begin(), mylist2);
285 mylist.merge(mylist2, std::greater<int>());
286 mylist.sort(std::greater<int>());
290 mylist.get_allocator();
295 exit_handler_intel_x64::unittest_1005_containers_list()
const 297 std::list<int> mylist = {{0, 1, 2, 3}};
298 std::list<int> mylist2 = {{0, 1, 2, 3}};
301 for (
auto iter = mylist.begin(); iter != mylist.end(); iter++)
305 for (
auto iter = mylist.rbegin(); iter != mylist.rend(); iter++)
309 for (
auto iter = mylist.cbegin(); iter != mylist.cend(); iter++)
313 for (
auto iter = mylist.crbegin(); iter != mylist.crend(); iter++)
336 mylist.push_front(4);
340 mylist.insert(mylist.begin(), 0);
341 mylist.erase(mylist.begin());
344 mylist.swap(mylist2);
347 mylist.emplace(mylist.begin());
348 mylist.emplace_back();
349 mylist.emplace_front();
360 mylist.splice(mylist.begin(), mylist2);
363 mylist.merge(mylist2, std::greater<int>());
364 mylist.sort(std::greater<int>());
368 mylist.get_allocator();
373 exit_handler_intel_x64::unittest_1006_containers_stack()
const 375 std::stack<int> mystack{{0, 1, 2, 3}};
376 std::stack<int> mystack2{{0, 1, 2, 3}};
389 mystack.swap(mystack2);
401 exit_handler_intel_x64::unittest_1007_containers_queue()
const 403 std::queue<int> myqueue{{0, 1, 2, 3}};
404 std::queue<int> myqueue2{{0, 1, 2, 3}};
422 myqueue.swap(myqueue2);
434 exit_handler_intel_x64::unittest_1008_containers_priority_queue()
const 436 int myints[] = {0, 1, 2, 3};
438 auto myqueue = std::priority_queue<int>(myints, myints + 4);
439 auto myqueue2 = std::priority_queue<int>(myints, myints + 4);
456 myqueue.swap(myqueue2);
461 exit_handler_intel_x64::unittest_1009_containers_set()
const 463 auto myset = std::set<int>({0, 1, 2, 3});
464 auto myset2 = std::set<int>({0, 1, 2, 3});
467 for (
auto iter = myset.begin(); iter != myset.end(); iter++)
471 for (
auto iter = myset.rbegin(); iter != myset.rend(); iter++)
475 for (
auto iter = myset.cbegin(); iter != myset.cend(); iter++)
479 for (
auto iter = myset.crbegin(); iter != myset.crend(); iter++)
491 myset.insert(myset.begin(), 0);
492 myset.erase(myset.begin());
499 myset.emplace_hint(myset.begin());
509 myset.equal_range(0);
511 myset.get_allocator();
516 exit_handler_intel_x64::unittest_100A_containers_map()
const 518 auto mymap = std::map<int, int>();
519 auto mymap2 = std::map<int, int>();
529 for (
auto iter = mymap.begin(); iter != mymap.end(); iter++)
530 total += iter->second;
533 for (
auto iter = mymap.rbegin(); iter != mymap.rend(); iter++)
534 rtotal += iter->second;
537 for (
auto iter = mymap.cbegin(); iter != mymap.cend(); iter++)
538 ctotal += iter->second;
541 for (
auto iter = mymap.crbegin(); iter != mymap.crend(); iter++)
542 crtotal += iter->second;
556 mymap.insert(std::pair<int, int>(4, 4));
564 mymap.emplace_hint(mymap.begin(), std::pair<int, int>(4, 4));
574 mymap.equal_range(0);
576 mymap.get_allocator();
for(auto offset=0UL;offset< size;offset+=x64::page_size)
void swap(unique_map_ptr_x64< T > &x, unique_map_ptr_x64< T > &y) noexcept