Ignore:
Timestamp:
Jul 18, 2023, 1:25:21 PM (22 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
da6db1a2
Parents:
c44705c (diff), 5454d77 (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
  • TabularUnified libcfa/src/iostream.cfa

    rc44705c rdb94b5d  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 10:12:39 2023
    13 // Update Count     : 1380
     12// Last Modified On : Tue Jul 18 10:42:51 2023
     13// Update Count     : 1401
    1414//
    1515
     
    3434#pragma GCC visibility push(default)
    3535
     36
    3637// *********************************** ostream ***********************************
    3738
     
    4344                return os;
    4445        } // ?|?
    45         void ?|?( ostype & os, bool b ) {
    46                 (ostype &)(os | b); ends( os );
    47         } // ?|?
     46        OSTYPE_VOID_IMPL( bool )
    4847
    4948        ostype & ?|?( ostype & os, char c ) {
     
    5251                return nosep( os );
    5352        } // ?|?
    54         void ?|?( ostype & os, char c ) {
    55                 (ostype &)(os | c); ends( os );
    56         } // ?|?
     53        OSTYPE_VOID_IMPL( char )
    5754
    5855        ostype & ?|?( ostype & os, signed char sc ) {
     
    6158                return os;
    6259        } // ?|?
    63         void ?|?( ostype & os, signed char sc ) {
    64                 (ostype &)(os | sc); ends( os );
    65         } // ?|?
     60        OSTYPE_VOID_IMPL( signed char )
    6661
    6762        ostype & ?|?( ostype & os, unsigned char usc ) {
     
    7065                return os;
    7166        } // ?|?
    72         void ?|?( ostype & os, unsigned char usc ) {
    73                 (ostype &)(os | usc); ends( os );
    74         } // ?|?
     67        OSTYPE_VOID_IMPL( unsigned char )
    7568
    7669        ostype & ?|?( ostype & os, short int si ) {
     
    7972                return os;
    8073        } // ?|?
    81         void & ?|?( ostype & os, short int si ) {
    82                 (ostype &)(os | si); ends( os );
    83         } // ?|?
     74        OSTYPE_VOID_IMPL( short int )
    8475
    8576        ostype & ?|?( ostype & os, unsigned short int usi ) {
     
    8879                return os;
    8980        } // ?|?
    90         void & ?|?( ostype & os, unsigned short int usi ) {
    91                 (ostype &)(os | usi); ends( os );
    92         } // ?|?
     81        OSTYPE_VOID_IMPL( unsigned short int )
    9382
    9483        ostype & ?|?( ostype & os, int i ) {
     
    9786                return os;
    9887        } // ?|?
    99         void & ?|?( ostype & os, int i ) {
    100                 (ostype &)(os | i); ends( os );
    101         } // ?|?
     88        OSTYPE_VOID_IMPL( int )
    10289
    10390        ostype & ?|?( ostype & os, unsigned int ui ) {
     
    10693                return os;
    10794        } // ?|?
    108         void & ?|?( ostype & os, unsigned int ui ) {
    109                 (ostype &)(os | ui); ends( os );
    110         } // ?|?
     95        OSTYPE_VOID_IMPL( unsigned int )
    11196
    11297        ostype & ?|?( ostype & os, long int li ) {
     
    115100                return os;
    116101        } // ?|?
    117         void & ?|?( ostype & os, long int li ) {
    118                 (ostype &)(os | li); ends( os );
    119         } // ?|?
     102        OSTYPE_VOID_IMPL( long int )
    120103
    121104        ostype & ?|?( ostype & os, unsigned long int uli ) {
     
    124107                return os;
    125108        } // ?|?
    126         void & ?|?( ostype & os, unsigned long int uli ) {
    127                 (ostype &)(os | uli); ends( os );
    128         } // ?|?
     109        OSTYPE_VOID_IMPL( unsigned long int )
    129110
    130111        ostype & ?|?( ostype & os, long long int lli ) {
     
    133114                return os;
    134115        } // ?|?
    135         void & ?|?( ostype & os, long long int lli ) {
    136                 (ostype &)(os | lli); ends( os );
    137         } // ?|?
     116        OSTYPE_VOID_IMPL( long long int )
    138117
    139118        ostype & ?|?( ostype & os, unsigned long long int ulli ) {
     
    142121                return os;
    143122        } // ?|?
    144         void & ?|?( ostype & os, unsigned long long int ulli ) {
    145                 (ostype &)(os | ulli); ends( os );
    146         } // ?|?
     123        OSTYPE_VOID_IMPL( unsigned long long int )
    147124
    148125        #if defined( __SIZEOF_INT128__ )
     
    176153                return os;
    177154        } // ?|?
    178         void & ?|?( ostype & os, int128 llli ) {
    179                 (ostype &)(os | llli); ends( os );
    180         } // ?|?
     155        OSTYPE_VOID_IMPL( int128 )
    181156
    182157        ostype & ?|?( ostype & os, unsigned int128 ullli ) {
     
    185160                return os;
    186161        } // ?|?
    187         void & ?|?( ostype & os, unsigned int128 ullli ) {
    188                 (ostype &)(os | ullli); ends( os );
    189         } // ?|?
     162        OSTYPE_VOID_IMPL( unsigned int128 )
    190163        #endif // __SIZEOF_INT128__
    191164
    192         #define PrintWithDP( os, format, val, ... ) \
     165        #define PRINT_WITH_DP( os, format, val, ... ) \
    193166                { \
    194167                        enum { size = 48 }; \
     
    206179        ostype & ?|?( ostype & os, float f ) {
    207180                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    208                 PrintWithDP( os, "%'g", f );
    209                 return os;
    210         } // ?|?
    211         void & ?|?( ostype & os, float f ) {
    212                 (ostype &)(os | f); ends( os );
    213         } // ?|?
     181                PRINT_WITH_DP( os, "%'g", f );
     182                return os;
     183        } // ?|?
     184        OSTYPE_VOID_IMPL( float )
    214185
    215186        ostype & ?|?( ostype & os, double d ) {
    216187                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    217                 PrintWithDP( os, "%'.*lg", d, DBL_DIG );
    218                 return os;
    219         } // ?|?
    220         void & ?|?( ostype & os, double d ) {
    221                 (ostype &)(os | d); ends( os );
    222         } // ?|?
     188                PRINT_WITH_DP( os, "%'.*lg", d, DBL_DIG );
     189                return os;
     190        } // ?|?
     191        OSTYPE_VOID_IMPL( double )
    223192
    224193        ostype & ?|?( ostype & os, long double ld ) {
    225194                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    226                 PrintWithDP( os, "%'.*Lg", ld, LDBL_DIG );
    227                 return os;
    228         } // ?|?
    229         void & ?|?( ostype & os, long double ld ) {
    230                 (ostype &)(os | ld); ends( os );
    231         } // ?|?
     195                PRINT_WITH_DP( os, "%'.*Lg", ld, LDBL_DIG );
     196                return os;
     197        } // ?|?
     198        OSTYPE_VOID_IMPL( long double )
    232199
    233200        ostype & ?|?( ostype & os, float _Complex fc ) {
    234201                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    235202//              os | crealf( fc ) | nonl;
    236                 PrintWithDP( os, "%'g", crealf( fc ) );
    237                 PrintWithDP( os, "%'+g", cimagf( fc ) );
     203                PRINT_WITH_DP( os, "%'g", crealf( fc ) );
     204                PRINT_WITH_DP( os, "%'+g", cimagf( fc ) );
    238205                fmt( os, "i" );
    239206                return os;
    240207        } // ?|?
    241         void & ?|?( ostype & os, float _Complex fc ) {
    242                 (ostype &)(os | fc); ends( os );
    243         } // ?|?
     208        OSTYPE_VOID_IMPL( float _Complex )
    244209
    245210        ostype & ?|?( ostype & os, double _Complex dc ) {
    246211                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    247212//              os | creal( dc ) | nonl;
    248                 PrintWithDP( os, "%'.*lg", creal( dc ), DBL_DIG );
    249                 PrintWithDP( os, "%'+.*lg", cimag( dc ), DBL_DIG );
     213                PRINT_WITH_DP( os, "%'.*lg", creal( dc ), DBL_DIG );
     214                PRINT_WITH_DP( os, "%'+.*lg", cimag( dc ), DBL_DIG );
    250215                fmt( os, "i" );
    251216                return os;
    252217        } // ?|?
    253         void & ?|?( ostype & os, double _Complex dc ) {
    254                 (ostype &)(os | dc); ends( os );
    255         } // ?|?
     218        OSTYPE_VOID_IMPL( double _Complex )
    256219
    257220        ostype & ?|?( ostype & os, long double _Complex ldc ) {
    258221                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    259222//              os | creall( ldc ) || nonl;
    260                 PrintWithDP( os, "%'.*Lg", creall( ldc ), LDBL_DIG );
    261                 PrintWithDP( os, "%'+.*Lg", cimagl( ldc ), LDBL_DIG );
     223                PRINT_WITH_DP( os, "%'.*Lg", creall( ldc ), LDBL_DIG );
     224                PRINT_WITH_DP( os, "%'+.*Lg", cimagl( ldc ), LDBL_DIG );
    262225                fmt( os, "i" );
    263226                return os;
    264227        } // ?|?
    265         void & ?|?( ostype & os, long double _Complex ldc ) {
    266                 (ostype &)(os | ldc); ends( os );
    267         } // ?|?
     228        OSTYPE_VOID_IMPL( long double _Complex )
    268229
    269230        ostype & ?|?( ostype & os, const char s[] ) {
     
    308269//              return write( os, s, len );
    309270        } // ?|?
    310         void ?|?( ostype & os, const char s[] ) {
    311                 (ostype &)(os | s); ends( os );
    312         } // ?|?
     271        OSTYPE_VOID_IMPL( const char * )
    313272
    314273//      ostype & ?|?( ostype & os, const char16_t * s ) {
     
    337296                return os;
    338297        } // ?|?
    339         void ?|?( ostype & os, const void * p ) {
    340                 (ostype &)(os | p); ends( os );
    341         } // ?|?
     298        OSTYPE_VOID_IMPL( const void * )
    342299
    343300        // manipulators
     
    442399
    443400// Default prefix for non-decimal prints is 0b, 0, 0x.
    444 #define IntegralFMTImpl( T, IFMTNP, IFMTP ) \
     401#define INTEGRAL_FMT_IMPL( T, IFMTNP, IFMTP ) \
    445402forall( ostype & | basic_ostream( ostype ) ) { \
    446403        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
     
    519476                return os; \
    520477        } /* ?|? */ \
    521         void ?|?( ostype & os, _Ostream_Manip(T) f ) { \
    522                 (ostype &)(os | f); ends( os ); \
    523         } /* ?|? */ \
    524 } // distribution
    525 
    526 IntegralFMTImpl( signed char,            "      *hh ", "      *.*hh " )
    527 IntegralFMTImpl( unsigned char,          "      *hh ", "      *.*hh " )
    528 IntegralFMTImpl( signed short int,       "      *h ",  "      *.*h " )
    529 IntegralFMTImpl( unsigned short int,     "      *h ",  "      *.*h " )
    530 IntegralFMTImpl( signed int,             "      * ",   "      *.* " )
    531 IntegralFMTImpl( unsigned int,           "      * ",   "      *.* " )
    532 IntegralFMTImpl( signed long int,        "      *l ",  "      *.*l " )
    533 IntegralFMTImpl( unsigned long int,      "      *l ",  "      *.*l " )
    534 IntegralFMTImpl( signed long long int,   "      *ll ", "      *.*ll " )
    535 IntegralFMTImpl( unsigned long long int, "      *ll ", "      *.*ll " )
     478        OSTYPE_VOID_IMPL( _Ostream_Manip(T) ) \
     479} // distribution
     480
     481INTEGRAL_FMT_IMPL( signed char,            "      *hh ", "      *.*hh " )
     482INTEGRAL_FMT_IMPL( unsigned char,          "      *hh ", "      *.*hh " )
     483INTEGRAL_FMT_IMPL( signed short int,       "      *h ",  "      *.*h " )
     484INTEGRAL_FMT_IMPL( unsigned short int,     "      *h ",  "      *.*h " )
     485INTEGRAL_FMT_IMPL( signed int,             "      * ",   "      *.* " )
     486INTEGRAL_FMT_IMPL( unsigned int,           "      * ",   "      *.* " )
     487INTEGRAL_FMT_IMPL( signed long int,        "      *l ",  "      *.*l " )
     488INTEGRAL_FMT_IMPL( unsigned long int,      "      *l ",  "      *.*l " )
     489INTEGRAL_FMT_IMPL( signed long long int,   "      *ll ", "      *.*ll " )
     490INTEGRAL_FMT_IMPL( unsigned long long int, "      *ll ", "      *.*ll " )
    536491
    537492
     
    602557} // base_128
    603558
    604 #define IntegralFMTImpl128( T ) \
     559#define INTEGRAL_FMT_IMPL128( T ) \
    605560forall( ostype & | basic_ostream( ostype ) ) { \
    606561        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
     
    619574                return os; \
    620575        } /* ?|? */ \
    621         void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); ends( os ); } \
    622 } // distribution
    623 
    624 IntegralFMTImpl128( int128 )
    625 IntegralFMTImpl128( unsigned int128 )
     576        OSTYPE_VOID_IMPL( _Ostream_Manip(T) ) \
     577} // distribution
     578
     579INTEGRAL_FMT_IMPL128( int128 )
     580INTEGRAL_FMT_IMPL128( unsigned int128 )
    626581#endif // __SIZEOF_INT128__
    627582
     
    635590#define SUFFIXES_END (SUFFIXES_START + (int)((sizeof(suffixes) / sizeof(char *) - 1) * 3))
    636591
    637 #define PrintWithDP2( os, format, ... ) \
     592#define PRINT_WITH_DP2( os, format, ... ) \
    638593        { \
    639594                if ( ! f.flags.eng ) { \
     
    676631        }
    677632
    678 #define FloatingPointFMTImpl( T, DFMTNP, DFMTP ) \
     633#define FLOATING_POINT_FMT_IMPL( T, DFMTNP, DFMTP ) \
    679634forall( ostype & | basic_ostream( ostype ) ) { \
    680635        static void eng( T &value, int & pc, int & exp10 ) { \
     
    707662                        fmtstr[sizeof(DFMTNP)-2] = f.base;                      /* sizeof includes '\0' */ \
    708663                        /* printf( "%g %d %s\n", f.val, f.wd, &fmtstr[star] ); */ \
    709                         PrintWithDP2( os, &fmtstr[star], f.wd, f.val ) \
     664                        PRINT_WITH_DP2( os, &fmtstr[star], f.wd, f.val ) \
    710665                } else {                                                                                /* precision */ \
    711666                        fmtstr[sizeof(DFMTP)-2] = f.base;                       /* sizeof includes '\0' */ \
    712667                        /* printf( "%g %d %d %s\n", f.val, f.wd, f.pc, &fmtstr[star] ); */ \
    713                         PrintWithDP2( os, &fmtstr[star], f.wd, f.pc, f.val ) \
     668                        PRINT_WITH_DP2( os, &fmtstr[star], f.wd, f.pc, f.val ) \
    714669                } /* if */ \
    715670                return os; \
    716671        } /* ?|? */ \
    717672\
    718         void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); ends( os ); } \
    719 } // distribution
    720 
    721 FloatingPointFMTImpl( double,      "      * ",  "      *.* " )
    722 FloatingPointFMTImpl( long double, "      *L ", "      *.*L " )
     673        OSTYPE_VOID_IMPL( _Ostream_Manip(T) ) \
     674} // distribution
     675
     676FLOATING_POINT_FMT_IMPL( double,      "      * ",  "      *.* " )
     677FLOATING_POINT_FMT_IMPL( long double, "      *L ", "      *.*L " )
    723678
    724679// *********************************** character ***********************************
     
    751706                return os;
    752707        } // ?|?
    753 
    754         void ?|?( ostype & os, _Ostream_Manip(char) f ) { (ostype &)(os | f); ends( os ); }
     708        OSTYPE_VOID_IMPL( _Ostream_Manip(char) )
    755709} // distribution
    756710
     
    799753                return os;
    800754        } // ?|?
    801 
    802         void ?|?( ostype & os, _Ostream_Manip(const char *) f ) { (ostype &)(os | f); ends( os ); }
     755        OSTYPE_VOID_IMPL( _Ostream_Manip(const char *) )
    803756} // distribution
    804757
     
    806759// *********************************** istream ***********************************
    807760
     761
     762#define ISTYPE_VOID_VAL_IMPL( T ) \
     763        void ?|?( istype & is, T t ) { \
     764                (istype &)(is | t); ends( is ); \
     765        } // ?|?
    808766
    809767forall( istype & | basic_istream( istype ) ) {
     
    819777                return is;
    820778        } // ?|?
    821         void ?|?( istype & is, bool & b ) {
    822                 (istype &)(is | b); ends( is );
    823         } // ?|?
     779        ISTYPE_VOID_IMPL( bool )
    824780
    825781        istype & ?|?( istype & is, char & c ) {
     
    833789                return is;
    834790        } // ?|?
    835         void ?|?( istype & is, char & c ) {
    836                 (istype &)(is | c); ends( is );
    837         } // ?|?
     791        ISTYPE_VOID_IMPL( char )
    838792
    839793        istype & ?|?( istype & is, signed char & sc ) {
     
    841795                return is;
    842796        } // ?|?
    843         void ?|?( istype & is, signed char & sc ) {
    844                 (istype &)(is | sc); ends( is );
    845         } // ?|?
     797        ISTYPE_VOID_IMPL( signed char )
    846798
    847799        istype & ?|?( istype & is, unsigned char & usc ) {
     
    849801                return is;
    850802        } // ?|?
    851         void ?|?( istype & is, unsigned char & usc ) {
    852                 (istype &)(is | usc); ends( is );
    853         } // ?|?
     803        ISTYPE_VOID_IMPL( unsigned char )
    854804
    855805        istype & ?|?( istype & is, short int & si ) {
     
    857807                return is;
    858808        } // ?|?
    859         void ?|?( istype & is, short int & si ) {
    860                 (istype &)(is | si); ends( is );
    861         } // ?|?
     809        ISTYPE_VOID_IMPL( short int )
    862810
    863811        istype & ?|?( istype & is, unsigned short int & usi ) {
     
    865813                return is;
    866814        } // ?|?
    867         void ?|?( istype & is, unsigned short int & usi ) {
    868                 (istype &)(is | usi); ends( is );
    869         } // ?|?
     815        ISTYPE_VOID_IMPL( unsigned short int )
    870816
    871817        istype & ?|?( istype & is, int & i ) {
     
    873819                return is;
    874820        } // ?|?
    875         void ?|?( istype & is, int & i ) {
    876                 (istype &)(is | i); ends( is );
    877         } // ?|?
     821        ISTYPE_VOID_IMPL( int )
    878822
    879823        istype & ?|?( istype & is, unsigned int & ui ) {
     
    881825                return is;
    882826        } // ?|?
    883         void ?|?( istype & is, unsigned int & ui ) {
    884                 (istype &)(is | ui); ends( is );
    885         } // ?|?
     827        ISTYPE_VOID_IMPL( unsigned int )
    886828
    887829        istype & ?|?( istype & is, long int & li ) {
     
    889831                return is;
    890832        } // ?|?
    891         void ?|?( istype & is, long int & li ) {
    892                 (istype &)(is | li); ends( is );
    893         } // ?|?
     833        ISTYPE_VOID_IMPL( long int )
    894834
    895835        istype & ?|?( istype & is, unsigned long int & ulli ) {
     
    897837                return is;
    898838        } // ?|?
    899         void ?|?( istype & is, unsigned long int & ulli ) {
    900                 (istype &)(is | ulli); ends( is );
    901         } // ?|?
     839        ISTYPE_VOID_IMPL( unsigned long int )
    902840
    903841        istype & ?|?( istype & is, long long int & lli ) {
     
    905843                return is;
    906844        } // ?|?
    907         void ?|?( istype & is, long long int & lli ) {
    908                 (istype &)(is | lli); ends( is );
    909         } // ?|?
     845        ISTYPE_VOID_IMPL( long long int )
    910846
    911847        istype & ?|?( istype & is, unsigned long long int & ulli ) {
     
    913849                return is;
    914850        } // ?|?
    915         void & ?|?( istype & is, unsigned long long int & ulli ) {
    916                 (istype &)(is | ulli); ends( is );
    917         } // ?|?
     851        ISTYPE_VOID_IMPL( unsigned long long int )
    918852
    919853        #if defined( __SIZEOF_INT128__ )
     
    921855                return (istype &)(is | (unsigned int128 &)llli);
    922856        } // ?|?
    923         void ?|?( istype & is, int128 & llli ) {
    924                 (istype &)(is | llli); ends( is );
    925         } // ?|?
     857        ISTYPE_VOID_IMPL( int128 )
    926858
    927859        istype & ?|?( istype & is, unsigned int128 & ullli ) {
     
    940872                return is;
    941873        } // ?|?
    942         void ?|?( istype & is, unsigned int128 & ullli ) {
    943                 (istype &)(is | ullli); ends( is );
    944         } // ?|?
     874        ISTYPE_VOID_IMPL( unsigned int128 )
    945875        #endif // __SIZEOF_INT128__
    946876
     
    949879                return is;
    950880        } // ?|?
    951         void ?|?( istype & is, float & f ) {
    952                 (istype &)(is | f); ends( is );
    953         } // ?|?
     881        ISTYPE_VOID_IMPL( float )
    954882
    955883        istype & ?|?( istype & is, double & d ) {
     
    957885                return is;
    958886        } // ?|?
    959         void ?|?( istype & is, double & d ) {
    960                 (istype &)(is | d); ends( is );
    961         } // ?|?
     887        ISTYPE_VOID_IMPL( double )
    962888
    963889        istype & ?|?( istype & is, long double & ld ) {
     
    965891                return is;
    966892        } // ?|?
    967         void ?|?( istype & is, long double & ld ) {
    968                 (istype &)(is | ld); ends( is );
    969         } // ?|?
     893        ISTYPE_VOID_IMPL( long double )
    970894
    971895        istype & ?|?( istype & is, float _Complex & fc ) {
     
    975899                return is;
    976900        } // ?|?
    977         void ?|?( istype & is, float _Complex & fc ) {
    978                 (istype &)(is | fc); ends( is );
    979         } // ?|?
     901        ISTYPE_VOID_IMPL( float _Complex )
    980902
    981903        istype & ?|?( istype & is, double _Complex & dc ) {
     
    985907                return is;
    986908        } // ?|?
    987         void ?|?( istype & is, double _Complex & dc ) {
    988                 (istype &)(is | dc); ends( is );
    989         } // ?|?
     909        ISTYPE_VOID_IMPL( double _Complex )
    990910
    991911        istype & ?|?( istype & is, long double _Complex & ldc ) {
     
    995915                return is;
    996916        } // ?|?
    997         void ?|?( istype & is, long double _Complex & ldc ) {
    998                 (istype &)(is | ldc); ends( is );
    999         } // ?|?
     917        ISTYPE_VOID_IMPL( long double _Complex )
    1000918
    1001919        // istype & ?|?( istype & is, const char fmt[] ) {
     
    1008926                return is;
    1009927        } // ?|?
    1010         void ?|?( istype & is, char s[] ) {
    1011                 (istype &)(is | s); ends( is );
    1012         } // ?|?
     928        ISTYPE_VOID_VAL_IMPL( char * )
    1013929
    1014930        // manipulators
     
    1072988                return is;
    1073989        } // ?|?
    1074         void ?|?( istype & is, _Istream_Cstr f ) {
    1075                 (istype &)(is | f); ends( is );
    1076         } // ?|?
     990        ISTYPE_VOID_VAL_IMPL( _Istream_Cstr )
    1077991
    1078992        istype & ?|?( istype & is, _Istream_Char f ) {
     
    1080994                return is;
    1081995        } // ?|?
    1082         void ?|?( istype & is, _Istream_Char f ) {
    1083                 (istype &)(is | f); ends( is );
    1084         } // ?|?
    1085 } // distribution
    1086 
    1087 #define InputFMTImpl( T, CODE ) \
     996        ISTYPE_VOID_VAL_IMPL( _Istream_Char )
     997} // distribution
     998
     999#define INPUT_FMT_IMPL( T, CODE ) \
    10881000forall( istype & | basic_istream( istype ) ) { \
    10891001        istype & ?|?( istype & is, _Istream_Manip(T) f ) { \
     
    10991011                return is; \
    11001012        } /* ?|? */ \
    1101         void ?|?( istype & is, _Istream_Manip(T) f ) { \
    1102                 (istype &)(is | f); ends( is ); \
    1103         } /* ?|? */ \
    1104 } // distribution
    1105 
    1106 InputFMTImpl( signed char, "hhi" )
    1107 InputFMTImpl( unsigned char, "hhi" )
    1108 InputFMTImpl( signed short int, "hi" )
    1109 InputFMTImpl( unsigned short int, "hi" )
    1110 InputFMTImpl( signed int, "i" )
    1111 InputFMTImpl( unsigned int, "i" )
    1112 InputFMTImpl( signed long int, "li" )
    1113 InputFMTImpl( unsigned long int, "li" )
    1114 InputFMTImpl( signed long long int, "lli" )
    1115 InputFMTImpl( unsigned long long int, "lli" )
    1116 
    1117 InputFMTImpl( float, "f" )
    1118 InputFMTImpl( double, "lf" )
    1119 InputFMTImpl( long double, "Lf" )
     1013        ISTYPE_VOID_VAL_IMPL( _Istream_Manip(T) ) \
     1014} // distribution
     1015
     1016INPUT_FMT_IMPL( signed char, "hhi" )
     1017INPUT_FMT_IMPL( unsigned char, "hhi" )
     1018INPUT_FMT_IMPL( signed short int, "hi" )
     1019INPUT_FMT_IMPL( unsigned short int, "hi" )
     1020INPUT_FMT_IMPL( signed int, "i" )
     1021INPUT_FMT_IMPL( unsigned int, "i" )
     1022INPUT_FMT_IMPL( signed long int, "li" )
     1023INPUT_FMT_IMPL( unsigned long int, "li" )
     1024INPUT_FMT_IMPL( signed long long int, "lli" )
     1025INPUT_FMT_IMPL( unsigned long long int, "lli" )
     1026
     1027INPUT_FMT_IMPL( float, "f" )
     1028INPUT_FMT_IMPL( double, "lf" )
     1029INPUT_FMT_IMPL( long double, "Lf" )
    11201030
    11211031forall( istype & | basic_istream( istype ) ) {
     
    11291039                return is;
    11301040        } // ?|?
    1131         void ?|?( istype & is, _Istream_Manip(float _Complex) fc ) {
    1132                 (istype &)(is | fc); ends( is );
    1133         } // ?|?
     1041        ISTYPE_VOID_VAL_IMPL( _Istream_Manip(float _Complex) )
    11341042
    11351043        istype & ?|?( istype & is, _Istream_Manip(double _Complex) dc ) {
     
    11421050                return is;
    11431051        } // ?|?
    1144         void ?|?( istype & is, _Istream_Manip(double _Complex) dc ) {
    1145                 (istype &)(is | dc); ends( is );
    1146         } // ?|?
     1052        ISTYPE_VOID_VAL_IMPL( _Istream_Manip(double _Complex) )
    11471053
    11481054        istype & ?|?( istype & is, _Istream_Manip(long double _Complex) ldc ) {
     
    11551061                return is;
    11561062        } // ?|?
    1157         void ?|?( istype & is, _Istream_Manip(long double _Complex) ldc ) {
    1158                 (istype &)(is | ldc); ends( is );
    1159         } // ?|?
     1063        ISTYPE_VOID_VAL_IMPL( _Istream_Manip(long double _Complex) )
    11601064} // distribution
    11611065
Note: See TracChangeset for help on using the changeset viewer.