-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp2.cpp
More file actions
39 lines (33 loc) · 792 Bytes
/
app2.cpp
File metadata and controls
39 lines (33 loc) · 792 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
38
39
#include "boost/signals2.hpp"
#include <iostream>
#include <vector>
static int some_function_app2(bool in, bool in2) {
if (in && in2) {
return 0;
} else {
throw 1;
}
}
int main() {
std::cout << "Hello, World!" << std::endl;
boost::signals2::signal<void(int)> sig;
sig.connect([](int i) {
if (i) {
std::cout << "Hello, World!" << std::endl;
}
});
sig(42);
try {
some_function_app2(true, true);
some_function_app2(true, false);
} catch (int e) {
std::cout << "Caught exception: " << e << std::endl;
}
std::string one_string{"abc"};
std::vector<std::string> string_vector{"a", "b", "c"};
string_vector.push_back("d");
string_vector.emplace_back("e");
std::vector<int> v = {1, 2, 3, 4, 5};
v.emplace_back(6);
return 0;
}