Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    rfd54fef r467c8b7  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Aug 24 08:31:35 2020
    13 // Update Count     : 1130
     12// Last Modified On : Sat Jan 16 11:24:50 2021
     13// Update Count     : 1131
    1414//
    1515
     
    3636
    3737
    38 forall( ostype & | ostream( ostype ) ) {
     38forall( dtype 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
    401406} // distribution
    402407
    403408// tuples
    404 forall( ostype &, T, Params... | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
     409forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
    405410        ostype & ?|?( ostype & os, T arg, Params rest ) {
    406411                (ostype &)(os | arg);                                                   // print first argument
     
    421426
    422427// writes the range [begin, end) to the given stream
    423 forall( ostype &, elt_type | writeable( elt_type, ostype ), iterator_type | iterator( iterator_type, elt_type ) ) {
     428forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) {
    424429        void write( iterator_type begin, iterator_type end, ostype & os ) {
    425430                void print( elt_type i ) { os | i; }
     
    442447// Default prefix for non-decimal prints is 0b, 0, 0x.
    443448#define IntegralFMTImpl( T, IFMTNP, IFMTP ) \
    444 forall( ostype & | ostream( ostype ) ) { \
     449forall( dtype ostype | ostream( ostype ) ) { \
    445450        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    446451                if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \
     
    535540// Default prefix for non-decimal prints is 0b, 0, 0x.
    536541#define IntegralFMTImpl128( T, SIGNED, CODE, IFMTNP, IFMTP ) \
    537 forall( ostype & | ostream( ostype ) ) \
     542forall( dtype ostype | ostream( ostype ) ) \
    538543static void base10_128( ostype & os, _Ostream_Manip(T) f ) { \
    539544        if ( f.val > UINT64_MAX ) { \
     
    552557        } /* if */ \
    553558} /* base10_128 */ \
    554 forall( ostype & | ostream( ostype ) ) { \
     559forall( dtype ostype | ostream( ostype ) ) { \
    555560        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    556561                if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \
     
    654659#if defined( __SIZEOF_INT128__ )
    655660// Default prefix for non-decimal prints is 0b, 0, 0x.
    656 forall( ostype & | ostream( ostype ) )
     661forall( dtype ostype | ostream( ostype ) )
    657662static 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 ) {
    658663        int wd = 1;                                                                                     // f.wd is never 0 because 0 implies left-pad
     
    719724
    720725#define IntegralFMTImpl128( T ) \
    721 forall( ostype & | ostream( ostype ) ) { \
     726forall( dtype ostype | ostream( ostype ) ) { \
    722727        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    723728                _Ostream_Manip(uint64_t) fmt; \
     
    767772
    768773#define FloatingPointFMTImpl( T, DFMTNP, DFMTP ) \
    769 forall( ostype & | ostream( ostype ) ) { \
     774forall( dtype ostype | ostream( ostype ) ) { \
    770775        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    771776                if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \
     
    801806// *********************************** character ***********************************
    802807
    803 forall( ostype & | ostream( ostype ) ) {
     808forall( dtype ostype | ostream( ostype ) ) {
    804809        ostype & ?|?( ostype & os, _Ostream_Manip(char) f ) {
    805810                if ( f.base != 'c' ) {                                                  // bespoke binary/octal/hex format
     
    834839// *********************************** C string ***********************************
    835840
    836 forall( ostype & | ostream( ostype ) ) {
     841forall( dtype ostype | ostream( ostype ) ) {
    837842        ostype & ?|?( ostype & os, _Ostream_Manip(const char *) f ) {
    838843                if ( ! f.val ) return os;                                               // null pointer ?
     
    882887
    883888
    884 forall( istype & | istream( istype ) ) {
     889forall( dtype istype | istream( istype ) ) {
    885890        istype & ?|?( istype & is, bool & b ) {
    886891                char val[6];
     
    10481053// *********************************** manipulators ***********************************
    10491054
    1050 forall( istype & | istream( istype ) )
     1055forall( dtype istype | istream( istype ) )
    10511056istype & ?|?( istype & is, _Istream_Cstr f ) {
    10521057        // skip xxx
     
    10831088} // ?|?
    10841089
    1085 forall( istype & | istream( istype ) )
     1090forall( dtype istype | istream( istype ) )
    10861091istype & ?|?( istype & is, _Istream_Char f ) {
    10871092        fmt( is, "%*c" );                                                                       // argument variable unused
     
    10901095
    10911096#define InputFMTImpl( T, CODE ) \
    1092 forall( istype & | istream( istype ) ) \
     1097forall( dtype istype | istream( istype ) ) \
    10931098istype & ?|?( istype & is, _Istream_Manip(T) f ) { \
    10941099        enum { size = 16 }; \
     
    11191124InputFMTImpl( long double, "Lf" )
    11201125
    1121 forall( istype & | istream( istype ) )
     1126forall( dtype istype | istream( istype ) )
    11221127istype & ?|?( istype & is, _Istream_Manip(float _Complex) fc ) {
    11231128        float re, im;
     
    11301135} // ?|?
    11311136
    1132 forall( istype & | istream( istype ) )
     1137forall( dtype istype | istream( istype ) )
    11331138istype & ?|?( istype & is, _Istream_Manip(double _Complex) dc ) {
    11341139        double re, im;
     
    11411146} // ?|?
    11421147
    1143 forall( istype & | istream( istype ) )
     1148forall( dtype istype | istream( istype ) )
    11441149istype & ?|?( istype & is, _Istream_Manip(long double _Complex) ldc ) {
    11451150        long double re, im;
Note: See TracChangeset for help on using the changeset viewer.