- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/array-collections/array-raii.hfa
r1665ee5 rcfbc56ec 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 132 120 // Array of uninits sees explicit ctor calls (only), and implied dtor calls 133 121 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 } 134 133 printf(" [1]\n"); 135 134 { … … 164 163 } 165 164 166 void test_extras();167 168 165 int main() { 169 166 printf("=== builtins\n"); … … 173 170 test_custom(); 174 171 175 printf("=== uninit ( uNoCtor[] )\n");172 printf("=== uninit\n"); 176 173 test_uninit(); 177 178 test_extras();179 174 }
Note: See TracChangeset
for help on using the changeset viewer.