Changes in / [6acd020:d2260ad]
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.hfa
r6acd020 rd2260ad 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 28 20:37:57202113 // Update Count : 23 012 // Last Modified On : Tue Jul 20 21:18:03 2021 13 // Update Count : 232 14 14 // 15 15 … … 148 148 149 149 150 EHM_EXCEPTION(Open_Failure)( 150 exception Open_Failure { 151 151 union { 152 152 ofstream * ostream; … … 155 155 // TEMPORARY: need polymorphic exceptions 156 156 int tag; // 1 => ostream; 0 => istream 157 );157 }; 158 158 159 159 void ?{}( Open_Failure & this, ofstream & ); -
tests/counter.cfa
r6acd020 rd2260ad 10 10 // Created On : Thu Feb 22 15:27:00 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:50:23 201813 // Update Count : 212 // Last Modified On : Tue Jul 20 21:25:30 2021 13 // Update Count : 4 14 14 // 15 16 #include <fstream.hfa> 15 17 16 18 // Tests unified increment/decrement builtin functions. … … 19 21 struct counter { int x; }; 20 22 21 counter& ?+=?( counter& c, one_t ) { ++c.x; return c; } 22 23 counter& ?-=?( counter& c, one_t ) { --c.x; return c; } 23 counter ?+=?( counter & c, one_t ) { ++c.x; return c; } 24 counter ?-=?( counter & c, one_t ) { --c.x; return c; } 24 25 25 26 int main() { … … 28 29 ++c; 29 30 c++; 30 printf("%d\n", c.x);31 sout | "inc" | c.x; 31 32 c -= 1; 32 33 --c; 33 34 c--; 34 printf("%d\n", c.x);35 sout | "dec" | c.x; 35 36 } 36 37
Note:
See TracChangeset
for help on using the changeset viewer.