Changeset 38d70ab for src/libcfa
- Timestamp:
- Aug 10, 2017, 4:04:15 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 59a75cb
- Parents:
- b38225d (diff), cd7ef0b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream
rb38225d r38d70ab 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 7 08:35:59201713 // Update Count : 1 1812 // Last Modified On : Wed Aug 9 16:42:47 2017 13 // Update Count : 131 14 14 // 15 15 … … 46 46 }; // ostream 47 47 48 trait writeable( otype T ) { 49 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T ); 48 // trait writeable( otype T ) { 49 // forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T ); 50 // }; // writeable 51 52 trait writeable( otype T, dtype ostype | ostream( ostype ) ) { 53 ostype * ?|?( ostype *, T ); 50 54 }; // writeable 51 55 … … 77 81 78 82 // tuples 79 forall( dtype ostype, otype T, ttype Params | ostream( ostype ) | writeable( T ) | { ostype * ?|?( ostype *, Params ); } ) ostype * ?|?( ostype * os, T arg, Params rest ); 83 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype * ?|?( ostype *, Params ); } ) 84 ostype * ?|?( ostype * os, T arg, Params rest ); 80 85 81 86 // manipulators … … 90 95 91 96 // writes the range [begin, end) to the given stream 92 forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )93 void write( iterator_type begin, iterator_type end, os _type *os );97 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) 98 void write( iterator_type begin, iterator_type end, ostype * os ); 94 99 95 forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )96 void write_reverse( iterator_type begin, iterator_type end, os _type *os );100 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) 101 void write_reverse( iterator_type begin, iterator_type end, ostype * os ); 97 102 98 103 //--------------------------------------- -
src/libcfa/iostream.c
rb38225d r38d70ab 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jul 16 21:12:03201713 // Update Count : 39812 // Last Modified On : Wed Aug 9 16:46:51 2017 13 // Update Count : 401 14 14 // 15 15 … … 193 193 194 194 // tuples 195 forall( dtype ostype, otype T, ttype Params | ostream( ostype ) | writeable( T) | { ostype * ?|?( ostype *, Params ); } )195 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype * ?|?( ostype *, Params ); } ) 196 196 ostype * ?|?( ostype * os, T arg, Params rest ) { 197 197 os | arg; // print first argument … … 256 256 //--------------------------------------- 257 257 258 forall( otype elttype | writeable( elttype ), otype iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )259 void write( iterator type begin, iteratortype end, ostype * os ) {260 void print( elt type i ) { os | i; }258 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) 259 void write( iterator_type begin, iterator_type end, ostype * os ) { 260 void print( elt_type i ) { os | i; } 261 261 for_each( begin, end, print ); 262 262 } // ?|? 263 263 264 forall( otype elttype | writeable( elttype ), otype iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )265 void write_reverse( iterator type begin, iteratortype end, ostype * os ) {266 void print( elt type i ) { os | i; }264 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) 265 void write_reverse( iterator_type begin, iterator_type end, ostype * os ) { 266 void print( elt_type i ) { os | i; } 267 267 for_each_reverse( begin, end, print ); 268 268 } // ?|?
Note: See TracChangeset
for help on using the changeset viewer.