Skip to content

Conversation

@hahnjo
Copy link
Member

@hahnjo hahnjo commented Jan 28, 2026

It requires to construct default objects. Before it would blindly call Cppyy::Construct and check the return value. This leads to a confusing error message from TClass::New even though conversion to std::vector subsequently succeeds (which doesn't need to construct default objects).

@hahnjo hahnjo requested a review from guitargeek January 28, 2026 09:02
@hahnjo hahnjo self-assigned this Jan 28, 2026
@hahnjo hahnjo requested a review from vepadulano as a code owner January 28, 2026 09:02
@hahnjo
Copy link
Member Author

hahnjo commented Jan 28, 2026

Obvious follow-up question: why do we need to default construct objects for conversion to initializer list, but not for vector? But since I'm ok with the vector overload for my case in the histograms, I'm not going to look further into this...

Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I only have minor formatting comments, but the changes look perfect to me!

Obvious follow-up question: why do we need to default construct objects for conversion to initializer list, but not for vector?

I don't know, but since the changes in this PR make sense no matter what the answer to that question is, I can look into this later.

It requires to construct default objects. Before it would blindly call
Cppyy::Construct and check the return value. This leads to a confusing
error message from TClass::New even though conversion to std::vector
subsequently succeeds (which doesn't need to construct default objects).
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Test Results

    22 files      22 suites   3d 10h 55m 39s ⏱️
 3 774 tests  3 774 ✅ 0 💤 0 ❌
75 020 runs  75 020 ✅ 0 💤 0 ❌

Results for commit f8804d0.

♻️ This comment has been updated with latest results.

@hahnjo hahnjo force-pushed the cppyy-initializer_list branch from cbf7522 to f8804d0 Compare January 28, 2026 12:54
@hahnjo hahnjo merged commit 43ea746 into root-project:master Jan 29, 2026
28 of 30 checks passed
@hahnjo hahnjo deleted the cppyy-initializer_list branch January 29, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants