Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/array-collections/array-raii.hfa

    rcfbc56ec r1665ee5  
    118118}
    119119
     120struct thing { int mem; };
     121void ?{}( thing & this, int i ) {
     122    (this.mem){ i };
     123    printf("ctor %d\n", this.mem);
     124}
     125void ?{}( thing & this ) {
     126    (this){ 999 };
     127}
     128void ^?{}( thing & this ) {
     129    printf("dtor %d\n", this.mem);
     130}
     131
    120132// Array of uninits sees explicit ctor calls (only), and implied dtor calls
    121133void 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     }
    133134    printf(" [1]\n");
    134135    {
     
    163164}
    164165
     166void test_extras();
     167
    165168int main() {
    166169    printf("=== builtins\n");
     
    170173    test_custom();
    171174
    172     printf("=== uninit\n");
     175    printf("=== uninit ( uNoCtor[] )\n");
    173176    test_uninit();
     177
     178    test_extras();
    174179}
Note: See TracChangeset for help on using the changeset viewer.