Bindings for std::span #969
Replies: 1 comment 6 replies
-
Nanobind is feature-scoped to C++17. It might make sense to develop some kind of C++20 (and beyond) extension layer, but I do not wish to have such functionality as part of this project. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Has there been any consideration to adding bindings for std::span or other span-like objects? I'm trying to write a binding and finding it's a challenge to juggle the lifetimes, and wondering if there's any prior art here. list_binding sadly doesn't seem to work well.
Going from python, it seems like there wouldn't be any real way to indicate that C++ owns the data without some kind of wrapper around the span object to free the refcount when the object is destroyed, and going from C++ seems even more dangerous unless you go through and immediately create castings/clones of every held object. Am I missing anything here?
Beta Was this translation helpful? Give feedback.
All reactions