Changeset f2898df for libcfa/src/collections/string_res.cfa
- Timestamp:
- Jan 19, 2024, 5:25:28 PM (6 months ago)
- Branches:
- master
- Children:
- 8abe4090, a4ed165
- Parents:
- dd10bf4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/collections/string_res.cfa
rdd10bf4 rf2898df 25 25 26 26 #include <assert.h> 27 #include <complex.h> // creal, cimag 27 28 28 29 //######################### VbyteHeap "header" ######################### … … 333 334 void ?{}(string_res & s, const char * rhs, size_t rhslnth) with(s) { 334 335 eagerCopyCtorHelper(s, rhs, rhslnth); 336 } 337 338 void ?{}( string_res & s, ssize_t rhs ) { 339 char buf[64]; 340 int len; 341 snprintf( buf, sizeof(buf)-1, "%zd%n", rhs, &len ); 342 ( s ){ buf, len }; 343 } 344 void ?{}( string_res & s, size_t rhs ) { 345 char buf[64]; 346 int len; 347 snprintf( buf, sizeof(buf)-1, "%zu%n", rhs, &len ); 348 ( s ){ buf, len }; 349 } 350 void ?{}( string_res & s, double rhs ) { 351 char buf[64]; 352 int len; 353 snprintf( buf, sizeof(buf)-1, "%g%n", rhs, &len ); 354 ( s ){ buf, len }; 355 } 356 void ?{}( string_res & s, long double rhs ) { 357 char buf[64]; 358 int len; 359 snprintf( buf, sizeof(buf)-1, "%Lg%n", rhs, &len ); 360 ( s ){ buf, len }; 361 } 362 void ?{}( string_res & s, double _Complex rhs ) { 363 char buf[64]; 364 int len; 365 snprintf( buf, sizeof(buf)-1, "%g+%gi%n", creal( rhs ), cimag( rhs ), &len ); 366 ( s ){ buf, len }; 367 } 368 void ?{}( string_res & s, long double _Complex rhs ) { 369 char buf[64]; 370 int len; 371 snprintf( buf, sizeof(buf)-1, "%Lg+%Lgi%n", creall( rhs ), cimagl( rhs ), &len ); 372 ( s ){ buf, len }; 335 373 } 336 374 … … 577 615 } 578 616 617 string_res & ?=?( string_res & s, ssize_t rhs ) { 618 string_res rhs2 = rhs; 619 s = rhs2; 620 return s; 621 } 622 string_res & ?=?( string_res & s, size_t rhs ) { 623 string_res rhs2 = rhs; 624 s = rhs2; 625 return s; 626 } 627 string_res & ?=?( string_res & s, double rhs ) { 628 string_res rhs2 = rhs; 629 s = rhs2; 630 return s; 631 } 632 string_res & ?=?( string_res & s, long double rhs ) { 633 string_res rhs2 = rhs; 634 s = rhs2; 635 return s; 636 } 637 string_res & ?=?( string_res & s, double _Complex rhs ) { 638 string_res rhs2 = rhs; 639 s = rhs2; 640 return s; 641 } 642 string_res & ?=?( string_res & s, long double _Complex rhs ) { 643 string_res rhs2 = rhs; 644 s = rhs2; 645 return s; 646 } 647 579 648 // Copy assignment operator 580 649 string_res & ?=?(string_res & s, const string_res & rhs) with( s ) {
Note: See TracChangeset
for help on using the changeset viewer.