centralized performance resources
This commit is contained in:
commit
50b15a1522
63 changed files with 328466 additions and 0 deletions
40
perf-cpp/scripts/struct.cc
Normal file
40
perf-cpp/scripts/struct.cc
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include <iostream>
|
||||
|
||||
class S {
|
||||
// void print() const { a = 3; std::cout << S::a << '\n'; }
|
||||
int a = 0;
|
||||
|
||||
public:
|
||||
S(int x) : x(x) {
|
||||
}
|
||||
int x{2};
|
||||
};
|
||||
|
||||
class X {
|
||||
int x;
|
||||
|
||||
public:
|
||||
X() : x(0) {};
|
||||
void get() {
|
||||
std::cout << "x; " << x << '\n';
|
||||
}
|
||||
int& y() {
|
||||
return x;
|
||||
}
|
||||
};
|
||||
|
||||
int main() {
|
||||
// S{}.print();
|
||||
// S.x;
|
||||
// std::cout << S{3}.x << '\n';
|
||||
|
||||
X x;
|
||||
auto& ret = x.y();
|
||||
|
||||
// ++ret;
|
||||
|
||||
x.get();
|
||||
|
||||
// X x;
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue