Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/counter.cfa

    r8bf9448 rdc8511c  
    1010// Created On       : Thu Feb 22 15:27:00 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 20 21:25:30 2021
    13 // Update Count     : 4
     12// Last Modified On : Tue Nov  6 17:50:23 2018
     13// Update Count     : 2
    1414//
    15 
    16 #include <fstream.hfa>
    1715
    1816// Tests unified increment/decrement builtin functions.
     
    2119struct counter { int x; };
    2220
    23 counter ?+=?( counter & c, one_t ) { ++c.x; return c; }
    24 counter ?-=?( counter & c, one_t ) { --c.x; return c; }
     21counter& ?+=?( counter& c, one_t ) { ++c.x; return c; }
     22
     23counter& ?-=?( counter& c, one_t ) { --c.x; return c; }
    2524
    2625int main() {
     
    2928    ++c;
    3029    c++;
    31     sout | "inc" | c.x;
     30    printf("%d\n", c.x);
    3231    c -= 1;
    3332    --c;
    3433    c--;
    35     sout | "dec" | c.x;
     34    printf("%d\n", c.x);
    3635}
    3736
Note: See TracChangeset for help on using the changeset viewer.