Skip to content

StrMergeL

Description

Merge str2 into the end of str with L-value (ownership-transfer) semantics. On success str2’s storage is taken into str and str2 is left zeroed.

Parameters

Name Direction Description
str in,out Destination Str.
str2 in,out Source Str. Zeroed on success.

Success

Returns true; str grew by str2->length; str2 is zeroed.

Failure

Returns false on allocation failure; str2 was already zeroed-on-take per the L-form invariant, str is unchanged.

Usage example (Cross-references)

Usage examples (Cross-references)
    // Test StrMergeL function
    bool test_str_merge_l(void) {
        WriteFmt("Testing StrMergeL\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        // Merge s2 into s1 (L-value semantics)
        StrMergeL(&s1, &s2);
    
        // Validate both vectors
    /// TAGS: Str, Merge
    ///
    #define StrMerge(str, str2) StrMergeL((str), (str2))
    
    ///
Last updated on