First commit
[cpp_sandbox.git] / Sandbox / NextAndExchange.cpp
1 #include "NextAndExchange.h"
2
3 #include <iostream>
4 #include <vector>
5 #include <algorithm>
6 using namespace std;
7
8 namespace NextAndExchange
9 {
10
11 }
12
13 void NextAndExchange::tests()
14 {
15 // 'next'.
16 vector<int> v{ 42, 420, 2, 3, 4, 5, 6, 7 };
17 cout << "Is the list sorted? " << is_sorted(next(v.begin()), v.end()) << endl;
18
19 // 'exchange'.
20 auto a = 1;
21 auto b = exchange(a, 2);
22 cout << "a = " << a << ", b = " << b << endl;
23 }