Changes in / [0cc818b:416cc86]


Ignore:
Location:
src/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/user_literals.txt

    r0cc818b r416cc86  
    5511.0714285714286
    6622.0457142857143
    7 secs 1
    8 secs 23
    9 mins 23
    10 hours 23
    11 _A_ 23
    12 _thingy_ 1234
    13 secs 65535
    14 mins 65535
    15 hours 65535
    16 _A_ 65535
    17 _thingy_ 65535
    18 secs 10
    19 hours 10
    20 mins 10
    21 _A_ 10
    22 _thingy_ 10
    23 secs abc
    24 mins 0x4058c6
    25 hours 0x4058d0
    26 _A_ 0x4058d0
    27 _thingy_ abc
  • src/tests/user_literals.c

    r0cc818b r416cc86  
    1010// Created On       : Wed Sep  6 21:40:50 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Sep  7 22:53:49 2017
    13 // Update Count     : 39
     12// Last Modified On : Wed Sep  6 23:19:08 2017
     13// Update Count     : 36
    1414//
    1515
    1616#include <fstream>
    17 #include <wchar.h>
    18 #include <uchar.h>
    19 
    20 int ?`s( int s ) { sout | "secs" | s | endl; }
    21 int ?`m( int m ) { sout | "mins" | m | endl; }
    22 int ?`h( int h ) { sout | "hours" | h | endl; }
    23 int ?`_A_( int x ) { sout | "_A_" | x | endl; }
    24 int ?`__thingy_( int x ) { sout | "_thingy_" | x | endl; }
    25 
    26 int ?`s( const char * s ) { sout | "secs" | s | endl; }
    27 int ?`m( const char16_t * m ) { sout | "mins" | m | endl; }
    28 int ?`h( const char32_t * h ) { sout | "hours" | h | endl; }
    29 int ?`_A_( const wchar_t * x ) { sout | "_A_" | x | endl; }
    30 int ?`__thingy_( const char * x ) { sout | "_thingy_" | x | endl; }
    31 
    3217
    3318struct Weight {
     
    4328Weight ?`lb( double w ) { return (Weight){ w / 14.0 }; }
    4429Weight ?`kg( double w ) { return (Weight) { w * 0.1575}; }
    45 
    4630
    4731int main() {
     
    5943    w = 5`st + 8`kg + 25`lb + hw;
    6044    sout | w | endl;
     45}
    6146
    62 //      0`secs;
    63         1`s;
    64         23`s;
    65         23u`m;
    66         23l`h;
    67         23_ul`_A_;
    68         1_234_LL`__thingy_;
    6947
    70         0xff_ffl;
    71         0xff_ff`s;
    72         0xff_ffu`m;
    73         0xff_ffl`h;
    74         0xff_fful`_A_;
    75         0xff_ffLL`__thingy_;
    76 
    77     '\n'`s;
    78     L'\n'`h;
    79     u'\n'`m;
    80     L_'\n'`_A_;
    81     U_'\n'`__thingy_;
    82 
    83         "abc"`s;
    84         u"abc"`m;
    85         U_"abc"`h;
    86         L"abc"`_A_;
    87         u8_"abc"`__thingy_;
    88 } // main
    8948
    9049// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.