Changes in src/examples/it_out.c [b63e376:86bd7c1f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/it_out.c
rb63e376 r86bd7c1f 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 8 22:14:39 201613 // Update Count : 812 // Last Modified On : Wed May 27 18:41:23 2015 13 // Update Count : 4 14 14 // 15 15 16 16 typedef unsigned long streamsize_type; 17 17 18 trait ostream( dtype os_type ) {18 context ostream( dtype os_type ) { 19 19 os_type *write( os_type *, const char *, streamsize_type ); 20 20 int fail( os_type * ); 21 21 }; 22 22 23 trait writeable( otype T ) {23 context writeable( type T ) { 24 24 forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, T ); 25 25 }; … … 29 29 forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, const char * ); 30 30 31 trait istream( dtype is_type ) {31 context istream( dtype is_type ) { 32 32 is_type *read( is_type *, char *, streamsize_type ); 33 33 is_type *unread( is_type *, char ); … … 36 36 }; 37 37 38 trait readable( otype T ) {38 context readable( type T ) { 39 39 forall( dtype is_type | istream( is_type ) ) is_type * ?<<?( is_type *, T ); 40 40 }; … … 43 43 forall( dtype is_type | istream( is_type ) ) is_type * ?>>?( is_type *, int* ); 44 44 45 trait iterator( otype iterator_type, otype elt_type ) {45 context iterator( type iterator_type, type elt_type ) { 46 46 iterator_type ?++( iterator_type* ); 47 47 iterator_type ++?( iterator_type* ); … … 52 52 }; 53 53 54 forall( otype elt_type | writeable( elt_type ),55 otype iterator_type | iterator( iterator_type, elt_type ),54 forall( type elt_type | writeable( elt_type ), 55 type iterator_type | iterator( iterator_type, elt_type ), 56 56 dtype os_type | ostream( os_type ) ) 57 57 void write_all( iterator_type begin, iterator_type end, os_type *os ); 58 58 59 forall( otype elt_type | writeable( elt_type ),60 otype iterator_type | iterator( iterator_type, elt_type ),59 forall( type elt_type | writeable( elt_type ), 60 type iterator_type | iterator( iterator_type, elt_type ), 61 61 dtype os_type | ostream( os_type ) ) 62 62 void write_all( elt_type begin, iterator_type end, os_type *os ) {
Note:
See TracChangeset
for help on using the changeset viewer.