Ignore:
Timestamp:
Jan 20, 2021, 4:49:40 PM (9 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
454f478
Parents:
92bfda0 (diff), fd54fef (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.hfa

    r92bfda0 rdafbde8  
    2222
    2323
    24 trait ostream( dtype ostype ) {
     24trait ostream( ostype & ) {
    2525        // private
    2626        bool $sepPrt( ostype & );                                                       // get separator state (on/off)
     
    5656}; // ostream
    5757
    58 // trait writeable( otype T ) {
    59 //      forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype &, T );
     58// trait writeable( T ) {
     59//      forall( ostype & | ostream( ostype ) ) ostype & ?|?( ostype &, T );
    6060// }; // writeable
    6161
    62 trait writeable( otype T, dtype ostype | ostream( ostype ) ) {
     62trait writeable( T, ostype & | ostream( ostype ) ) {
    6363        ostype & ?|?( ostype &, T );
    6464}; // writeable
     
    6666// implement writable for intrinsic types
    6767
    68 forall( dtype ostype | ostream( ostype ) ) {
     68forall( ostype & | ostream( ostype ) ) {
    6969        ostype & ?|?( ostype &, bool );
    7070        void ?|?( ostype &, bool );
     
    140140
    141141// tuples
    142 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
     142forall( ostype &, T, Params... | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
    143143        ostype & ?|?( ostype & os, T arg, Params rest );
    144144        void ?|?( ostype & os, T arg, Params rest );
     
    146146
    147147// writes the range [begin, end) to the given stream
    148 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) {
     148forall( ostype &, elt_type | writeable( elt_type, ostype ), iterator_type | iterator( iterator_type, elt_type ) ) {
    149149        void write( iterator_type begin, iterator_type end, ostype & os );
    150150        void write_reverse( iterator_type begin, iterator_type end, ostype & os );
     
    153153// *********************************** manipulators ***********************************
    154154
    155 forall( otype T )
     155forall( T )
    156156struct _Ostream_Manip {
    157157        T val;                                                                                          // polymorphic base-type
     
    193193        _Ostream_Manip(T) & sign( _Ostream_Manip(T) & fmt ) { fmt.flags.sign = true; return fmt; } \
    194194} /* distribution */ \
    195 forall( dtype ostype | ostream( ostype ) ) { \
     195forall( ostype & | ostream( ostype ) ) { \
    196196        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ); \
    197197        void ?|?( ostype & os, _Ostream_Manip(T) f ); \
     
    234234        _Ostream_Manip(T) & nodp( _Ostream_Manip(T) & fmt ) { fmt.flags.nobsdp = true; return fmt; } \
    235235} /* distribution */ \
    236 forall( dtype ostype | ostream( ostype ) ) { \
     236forall( ostype & | ostream( ostype ) ) { \
    237237        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ); \
    238238        void ?|?( ostype & os, _Ostream_Manip(T) f ); \
     
    254254        _Ostream_Manip(char) & nobase( _Ostream_Manip(char) & fmt ) { fmt.flags.nobsdp = true; return fmt; }
    255255} // distribution
    256 forall( dtype ostype | ostream( ostype ) ) {
     256forall( ostype & | ostream( ostype ) ) {
    257257        ostype & ?|?( ostype & os, _Ostream_Manip(char) f );
    258258        void ?|?( ostype & os, _Ostream_Manip(char) f );
     
    272272        _Ostream_Manip(const char *) & nobase( _Ostream_Manip(const char *) & fmt ) { fmt.flags.nobsdp = true; return fmt; }
    273273} // distribution
    274 forall( dtype ostype | ostream( ostype ) ) {
     274forall( ostype & | ostream( ostype ) ) {
    275275        ostype & ?|?( ostype & os, _Ostream_Manip(const char *) f );
    276276        void ?|?( ostype & os, _Ostream_Manip(const char *) f );
     
    281281
    282282
    283 trait istream( dtype istype ) {
     283trait istream( istype & ) {
    284284        void nlOn( istype & );                                                          // read newline
    285285        void nlOff( istype & );                                                         // scan newline
     
    294294}; // istream
    295295
    296 trait readable( otype T ) {
    297         forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, T );
     296trait readable( T ) {
     297        forall( istype & | istream( istype ) ) istype & ?|?( istype &, T );
    298298}; // readable
    299299
    300 forall( dtype istype | istream( istype ) ) {
     300forall( istype & | istream( istype ) ) {
    301301        istype & ?|?( istype &, bool & );
    302302
     
    363363        _Istream_Cstr & wdi( unsigned int w, _Istream_Cstr & fmt ) { fmt.wd = w; return fmt; }
    364364} // distribution
    365 forall( dtype istype | istream( istype ) ) istype & ?|?( istype & is, _Istream_Cstr f );
     365forall( istype & | istream( istype ) ) istype & ?|?( istype & is, _Istream_Cstr f );
    366366
    367367struct _Istream_Char {
     
    373373        _Istream_Char & ignore( _Istream_Char & fmt ) { fmt.ignore = true; return fmt; }
    374374} // distribution
    375 forall( dtype istype | istream( istype ) ) istype & ?|?( istype & is, _Istream_Char f );
    376 
    377 forall( dtype T | sized( T ) )
     375forall( istype & | istream( istype ) ) istype & ?|?( istype & is, _Istream_Char f );
     376
     377forall( T & | sized( T ) )
    378378struct _Istream_Manip {
    379379        T & val;                                                                                        // polymorphic base-type
     
    389389        _Istream_Manip(T) & wdi( unsigned int w, _Istream_Manip(T) & fmt ) { fmt.wd = w; return fmt; } \
    390390} /* distribution */ \
    391 forall( dtype istype | istream( istype ) ) { \
     391forall( istype & | istream( istype ) ) { \
    392392        istype & ?|?( istype & is, _Istream_Manip(T) f ); \
    393393} // ?|?
     
    418418#include <time_t.hfa>                                                                   // Duration (constructors) / Time (constructors)
    419419
    420 forall( dtype ostype | ostream( ostype ) ) {
     420forall( ostype & | ostream( ostype ) ) {
    421421        ostype & ?|?( ostype & os, Duration dur );
    422422        void ?|?( ostype & os, Duration dur );
Note: See TracChangeset for help on using the changeset viewer.