Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r467c8b7 rfd54fef  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jan 16 11:24:50 2021
    13 // Update Count     : 1131
     12// Last Modified On : Mon Aug 24 08:31:35 2020
     13// Update Count     : 1130
    1414//
    1515
     
    3636
    3737
    38 forall( dtype ostype | ostream( ostype ) ) {
     38forall( ostype & | ostream( ostype ) ) {
    3939        ostype & ?|?( ostype & os, bool b ) {
    4040                if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) );
     
    399399                return os;
    400400        } // nlOff
    401 
    402         ostype & acquire( ostype & os ) {
    403                 acquire( os );                                                                  // call void returning
    404                 return os;
    405         } // nlOff
    406401} // distribution
    407402
    408403// tuples
    409 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
     404forall( ostype &, T, Params... | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
    410405        ostype & ?|?( ostype & os, T arg, Params rest ) {
    411406                (ostype &)(os | arg);                                                   // print first argument
     
    426421
    427422// writes the range [begin, end) to the given stream
    428 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) {
     423forall( ostype &, elt_type | writeable( elt_type, ostype ), iterator_type | iterator( iterator_type, elt_type ) ) {
    429424        void write( iterator_type begin, iterator_type end, ostype & os ) {
    430425                void print( elt_type i ) { os | i; }
     
    447442// Default prefix for non-decimal prints is 0b, 0, 0x.
    448443#define IntegralFMTImpl( T, IFMTNP, IFMTP ) \
    449 forall( dtype ostype | ostream( ostype ) ) { \
     444forall( ostype & | ostream( ostype ) ) { \
    450445        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    451446                if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \
     
    540535// Default prefix for non-decimal prints is 0b, 0, 0x.
    541536#define IntegralFMTImpl128( T, SIGNED, CODE, IFMTNP, IFMTP ) \
    542 forall( dtype ostype | ostream( ostype ) ) \
     537forall( ostype & | ostream( ostype ) ) \
    543538static void base10_128( ostype & os, _Ostream_Manip(T) f ) { \
    544539        if ( f.val > UINT64_MAX ) { \
     
    557552        } /* if */ \
    558553} /* base10_128 */ \
    559 forall( dtype ostype | ostream( ostype ) ) { \
     554forall( ostype & | ostream( ostype ) ) { \
    560555        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    561556                if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \
     
    659654#if defined( __SIZEOF_INT128__ )
    660655// Default prefix for non-decimal prints is 0b, 0, 0x.
    661 forall( dtype ostype | ostream( ostype ) )
     656forall( ostype & | ostream( ostype ) )
    662657static inline void base_128( ostype & os, unsigned int128 val, unsigned int128 power, _Ostream_Manip(uint64_t) & f, unsigned int maxdig, unsigned int bits, unsigned int cnt = 0 ) {
    663658        int wd = 1;                                                                                     // f.wd is never 0 because 0 implies left-pad
     
    724719
    725720#define IntegralFMTImpl128( T ) \
    726 forall( dtype ostype | ostream( ostype ) ) { \
     721forall( ostype & | ostream( ostype ) ) { \
    727722        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    728723                _Ostream_Manip(uint64_t) fmt; \
     
    772767
    773768#define FloatingPointFMTImpl( T, DFMTNP, DFMTP ) \
    774 forall( dtype ostype | ostream( ostype ) ) { \
     769forall( ostype & | ostream( ostype ) ) { \
    775770        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    776771                if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \
     
    806801// *********************************** character ***********************************
    807802
    808 forall( dtype ostype | ostream( ostype ) ) {
     803forall( ostype & | ostream( ostype ) ) {
    809804        ostype & ?|?( ostype & os, _Ostream_Manip(char) f ) {
    810805                if ( f.base != 'c' ) {                                                  // bespoke binary/octal/hex format
     
    839834// *********************************** C string ***********************************
    840835
    841 forall( dtype ostype | ostream( ostype ) ) {
     836forall( ostype & | ostream( ostype ) ) {
    842837        ostype & ?|?( ostype & os, _Ostream_Manip(const char *) f ) {
    843838                if ( ! f.val ) return os;                                               // null pointer ?
     
    887882
    888883
    889 forall( dtype istype | istream( istype ) ) {
     884forall( istype & | istream( istype ) ) {
    890885        istype & ?|?( istype & is, bool & b ) {
    891886                char val[6];
     
    10531048// *********************************** manipulators ***********************************
    10541049
    1055 forall( dtype istype | istream( istype ) )
     1050forall( istype & | istream( istype ) )
    10561051istype & ?|?( istype & is, _Istream_Cstr f ) {
    10571052        // skip xxx
     
    10881083} // ?|?
    10891084
    1090 forall( dtype istype | istream( istype ) )
     1085forall( istype & | istream( istype ) )
    10911086istype & ?|?( istype & is, _Istream_Char f ) {
    10921087        fmt( is, "%*c" );                                                                       // argument variable unused
     
    10951090
    10961091#define InputFMTImpl( T, CODE ) \
    1097 forall( dtype istype | istream( istype ) ) \
     1092forall( istype & | istream( istype ) ) \
    10981093istype & ?|?( istype & is, _Istream_Manip(T) f ) { \
    10991094        enum { size = 16 }; \
     
    11241119InputFMTImpl( long double, "Lf" )
    11251120
    1126 forall( dtype istype | istream( istype ) )
     1121forall( istype & | istream( istype ) )
    11271122istype & ?|?( istype & is, _Istream_Manip(float _Complex) fc ) {
    11281123        float re, im;
     
    11351130} // ?|?
    11361131
    1137 forall( dtype istype | istream( istype ) )
     1132forall( istype & | istream( istype ) )
    11381133istype & ?|?( istype & is, _Istream_Manip(double _Complex) dc ) {
    11391134        double re, im;
     
    11461141} // ?|?
    11471142
    1148 forall( dtype istype | istream( istype ) )
     1143forall( istype & | istream( istype ) )
    11491144istype & ?|?( istype & is, _Istream_Manip(long double _Complex) ldc ) {
    11501145        long double re, im;
Note: See TracChangeset for help on using the changeset viewer.