Changes in / [0cc818b:416cc86]
- Location:
- src/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/user_literals.txt
r0cc818b r416cc86 5 5 11.0714285714286 6 6 22.0457142857143 7 secs 18 secs 239 mins 2310 hours 2311 _A_ 2312 _thingy_ 123413 secs 6553514 mins 6553515 hours 6553516 _A_ 6553517 _thingy_ 6553518 secs 1019 hours 1020 mins 1021 _A_ 1022 _thingy_ 1023 secs abc24 mins 0x4058c625 hours 0x4058d026 _A_ 0x4058d027 _thingy_ abc -
src/tests/user_literals.c
r0cc818b r416cc86 10 10 // Created On : Wed Sep 6 21:40:50 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Sep 7 22:53:49201713 // Update Count : 3 912 // Last Modified On : Wed Sep 6 23:19:08 2017 13 // Update Count : 36 14 14 // 15 15 16 16 #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 32 17 33 18 struct Weight { … … 43 28 Weight ?`lb( double w ) { return (Weight){ w / 14.0 }; } 44 29 Weight ?`kg( double w ) { return (Weight) { w * 0.1575}; } 45 46 30 47 31 int main() { … … 59 43 w = 5`st + 8`kg + 25`lb + hw; 60 44 sout | w | endl; 45 } 61 46 62 // 0`secs;63 1`s;64 23`s;65 23u`m;66 23l`h;67 23_ul`_A_;68 1_234_LL`__thingy_;69 47 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 } // main89 48 90 49 // Local Variables: //
Note: See TracChangeset
for help on using the changeset viewer.