Changeset c4f8c4bf for tests/collections/string-operator.cfa
- Timestamp:
- Apr 11, 2025, 1:23:19 PM (6 months ago)
- Branches:
- master
- Children:
- 602ac05, cefaa2df
- Parents:
- dab6e39
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/collections/string-operator.cfa
rdab6e39 rc4f8c4bf 322 322 printf( "0x%x 0x%x\n", ch, ch + 3 ); // 0x3 0x6 323 323 } 324 sout | nl; 325 326 s = ""; 327 s += 'a'; sout | s; // a 328 s += "a"; sout | s; // aa 329 s += s; sout | s; // aaaa 330 sout | nl; 331 332 s = ""; 333 s += 'a' + 'b'; sout | s; // ab 334 s += "a" + "b"; sout | s; // abab 335 s += s + 'a' + 'b'; sout | s; // ababababab 336 sout | nl; 337 338 { 339 char ch = 42; sout | (unsigned char) ch; // 42 340 ch += 'a'; sout | (unsigned char) ch; // 139 341 sout | nl; 342 } 343 344 { 345 char retc = 'a'; 346 string rets = "a"; 347 char & weird() { return retc; } 348 string & weird() { return rets; } 349 (return char &) weird(); 350 (return string &) weird(); 351 weird() += 'b'; // (ideally ambiguous) 352 sout | retc | ' ' | rets; // a ab (known approximation flaw) 353 } 324 354 }
Note:
See TracChangeset
for help on using the changeset viewer.