⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@guitargeek
Copy link
Contributor

Backport of #20891 as requested by @sponce

The libstdc++ (GCC >= 15) implements `std::span::iterator` using a
private nested tag type, which makes the iterator non-instantiable by
CallFunc-generated wrappers (the return type cannot be named without
violating access rules).

To preserve correct Python iteration semantics, this commit suggests to
replace `begin()`/`end()` for `std::span` to return a custom
pointer-based iterator instead. This avoids relying on
`std::span::iterator` while still providing a real C++ iterator object
that CPyCppyy can also wrap and expose via `__iter__`/`__next__`.

A unit test is implemented based on the reproducers provided in root-project#18837.

Closes root-project#18837.

(cherry picked from commit 598e301)
@guitargeek guitargeek self-assigned this Jan 17, 2026
@guitargeek guitargeek requested a review from dpiparo as a code owner January 17, 2026 15:23
@guitargeek guitargeek merged commit edd69e4 into root-project:v6-36-00-patches Jan 17, 2026
19 of 21 checks passed
@guitargeek guitargeek deleted the bp_2 branch January 17, 2026 18:07
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.

1 participant