feat: implement CPP07 C++20 card

This commit is contained in:
user
2026-07-21 20:11:42 +02:00
commit b9faa3cdab
36 changed files with 7620 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
#include <iostream>
struct Member { Member() { std::cout << "member\n"; } };
struct Object { Member member; Object() { std::cout << "object\n"; } };
int main() { Object object; (void)object; std::cout << "ready\n"; }
+4
View File
@@ -0,0 +1,4 @@
#include <iostream>
struct Trace { const char* name; explicit Trace(const char* value) : name{value} { std::cout << "construct=" << name << '\n'; } ~Trace() { std::cout << "destroy=" << name << '\n'; } };
void scope() { Trace first{"A"}; Trace second{"B"}; }
int main() { std::cout << "enter\n"; scope(); std::cout << "leave\n"; }
+3
View File
@@ -0,0 +1,3 @@
#include <iostream>
class Point { public: Point() : Point{0, 0} {} Point(int x, int y) : x_{x}, y_{y} {} int x() const { return x_; } int y() const { return y_; } private: int x_; int y_; };
int main() { Point point; Point other{3, 4}; std::cout << "point=" << point.x() << ',' << point.y() << " other=" << other.x() << ',' << other.y() << '\n'; }