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)
- In
Str.Insert.c:261:
// Test StrMergeL function
bool test_str_merge_l(void) {
WriteFmt("Testing StrMergeL\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Insert.c:269:
// Merge s2 into s1 (L-value semantics)
StrMergeL(&s1, &s2);
// Validate both vectors
- In
Insert.h:400:
/// TAGS: Str, Merge
///
#define StrMerge(str, str2) StrMergeL((str), (str2))
///
Last updated on