Skip to content

[core] Support string views and C strings in Join - #23392

Open
Shubham-Padkonde wants to merge 2 commits into
root-project:masterfrom
Shubham-Padkonde:fix/join-string-views
Open

Shubham-Padkonde wants to merge 2 commits into
root-project:masterfrom
Shubham-Padkonde:fix/join-string-views

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

ROOT::Join cannot compile when its input is a container of std::string_view or an array of C strings. std::accumulate infers the accumulator type from the input element, and the concatenation assumes owning strings.

Build the result in an owning std::string and append each element and separator. This also avoids repeatedly copying the entire accumulated prefix. Existing empty-string and separator behavior is preserved.

Add coverage for non-null-terminated string views, the iterator overload, and a C-string array containing an empty element.

Validation: the new tests fail to compile on the original implementation. All six StringUtils tests pass with the fix, built directly with GCC 13, C++17, -Wall -Wextra -Werror, and GoogleTest. Changed lines were formatted with the repository clang-format configuration. Full ROOT build and CI were not run locally.

AI disclosure: Codex prepared the implementation, tests, and description. The contributor must review and understand the patch before submitting, as required by ROOT's contribution policy.

Comment thread core/foundation/inc/ROOT/StringUtils.hxx Outdated
@hageboeck hageboeck self-assigned this Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 19h 34m 56s ⏱️
 3 876 tests  3 870 ✅ 0 💤 6 ❌
80 051 runs  80 045 ✅ 0 💤 6 ❌

For more details on these failures, see this check.

Results for commit b521e13.

♻️ This comment has been updated with latest results.

@hageboeck hageboeck added the clean build Ask CI to do non-incremental build on PR label Sep 17, 2026
@hageboeck

Copy link
Copy Markdown
Member

Closing & reopening to force a clean build

@hageboeck hageboeck closed this Sep 17, 2026
@hageboeck hageboeck reopened this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Assisted clean build Ask CI to do non-incremental build on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants