StrMergeR
- Macro
- October 8, 2025
Table of Contents
StrMergeR
StrMergeRDescription
Merge two strings and store the result in first string, with R-value semantics. Data is copied from str2 into str. If a copy_init method is provided in str, each element from str2 will be copied using that method. Otherwise, a raw memory copy is performed.
Note
Unlike StrMergeL, this does NOT zero out the source string’s data after merging.
Parameters
| Name | Direction | Description |
|---|---|---|
str | in,out | Str to insert array chars into. |
str2 | in | Str to be inserted. |
Success
str
Failure
NULL
Usage example (Cross-references)
- In
Str.Insert.c:271:
// Test StrMergeR function
bool test_str_merge_r(void) {
WriteFmt("Testing StrMergeR\n");
Str s1 = StrInitFromZstr("Hello");
- In
Str.Insert.c:277:
// Merge s2 into s1 (R-value semantics)
StrMergeR(&s1, &s2);
// Check that the strings were merged correctly
- In
Insert.h:217:
/// FAILURE : NULL
///
#define StrMerge(str, str2) StrMergeR((str), (str2))
///