Changes in src/tests/memberCtors.c [2afec66:72f85de]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/memberCtors.c
r2afec66 r72f85de 22 22 } 23 23 24 void ?=?(WrappedInt & this, int x) {24 /* WrappedInt */ void ?=?(WrappedInt & this, int x) { 25 25 printf("assigning int: %d %d\n", this.x, x); 26 26 this.x = x; 27 // return this; 27 28 } 29 30 // WrappedInt ?=?(WrappedInt & this, WrappedInt other) { 31 // printf("assigning int: %d %d\n", this.x, other.x); 32 // this.x = other.x; 33 // return this; 34 // } 28 35 29 36 struct A { … … 79 86 80 87 void ^?{}(B & b) { 88 printf("begin destruct B\n"); 81 89 b.a2 = (A) { 0 }; 82 90 ^(b.a1){}; 91 printf("end destruct B\n"); 83 92 } // a2, a3 never destructed - will be automatically destructed 84 93 85 94 int main() { 86 95 printf("Before declaration of b1\n"); 87 B b1; 96 B b1; // b1 = { { 1000, 0, 0 }, { 1001, 0, 0 }, { 0, 0, 0 } } 88 97 printf("Before declaration of b2\n"); 89 98 B b2 = b1;
Note: See TracChangeset
for help on using the changeset viewer.