- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/array-collections/array-raii.hfa
rcfbc56ec r1665ee5 118 118 } 119 119 120 struct thing { int mem; }; 121 void ?{}( thing & this, int i ) { 122 (this.mem){ i }; 123 printf("ctor %d\n", this.mem); 124 } 125 void ?{}( thing & this ) { 126 (this){ 999 }; 127 } 128 void ^?{}( thing & this ) { 129 printf("dtor %d\n", this.mem); 130 } 131 120 132 // Array of uninits sees explicit ctor calls (only), and implied dtor calls 121 133 void test_uninit() { 122 struct thing { int mem; };123 void ?{}( thing & this, int i ) {124 (this.mem){ i };125 printf("ctor %d\n", this.mem);126 }127 void ?{}( thing & this ) {128 (this){ 999 };129 }130 void ^?{}( thing & this ) {131 printf("dtor %d\n", this.mem);132 }133 134 printf(" [1]\n"); 134 135 { … … 163 164 } 164 165 166 void test_extras(); 167 165 168 int main() { 166 169 printf("=== builtins\n"); … … 170 173 test_custom(); 171 174 172 printf("=== uninit \n");175 printf("=== uninit ( uNoCtor[] )\n"); 173 176 test_uninit(); 177 178 test_extras(); 174 179 }
Note: See TracChangeset
for help on using the changeset viewer.