Ignore:
Timestamp:
Jan 17, 2024, 6:31:03 PM (8 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
906d8fa
Parents:
11f65b3
Message:

Harmonize string constructors with assignments, refactor implementations to include string_res, add missing tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/string_res.hfa

    r11f65b3 r7abc3de  
    7878    (s){ rhs, strlen(rhs) };
    7979}
    80 
     80static inline void ?{}(string_res & s, char c ) {
     81    ?{}( s, &c, 1);
     82}
     83
     84// Deleting the copy constructors makes the compiler reject an attempt to call/return by value
    8185void ?{}(string_res & s, const string_res & s2) = void;
    8286void ?{}(string_res & s, string_res & s2) = void;
     
    8690static inline void ?{}(string_res & s, const string_res & src, StrResInitMode mode ) {
    8791    ?{}( s, src, mode, 0, size(src));
     92}
     93static inline void ?{}(string_res & s, const string_res & src, StrResInitMode mode, size_t maxlen ) {
     94    ?{}( s, src, mode, 0, (size(src) > maxlen)?maxlen:size(src) );
    8895}
    8996
Note: See TracChangeset for help on using the changeset viewer.