Replies: 1 comment 4 replies
-
This header is tricky for me to change because it is a break under SemVer. (i.e. must be postponed to next major version). |
Beta Was this translation helpful? Give feedback.
4 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.
Uh oh!
There was an error while loading. Please reload this page.
-
There's this section in include/nanobind/intrusive/ref.h:
For my project, I only include counter.h, counter.inl, and ref.h in the main C++ library which I'd like to keep largely independent from nanobind and python, while I have a separate python binding component that includes nanobind.h, etc. My impression is that the intrusive ref counter is implemented specifically to allow this independence.
I'm not an expert on the C++ build process, but I think with this setup you won't be able to include the
type_caster
code even if youre-include ref.h followed by nanobind.h in the binding codeinclude nanobind.h then include ref.h in the binding code. So currently, my workaround is to simply copy paste thetype_caster
code in my binding code. Alternatively, I guess I could also use an #ifdef guard to include nanobind.h in my main C++ library when building the python extension.However, it seems more reasonable to me to have the ref.h
type_caster
code in a separate header file that can be included with your binding code. That way you also wouldn't have to worry about the order of your#include
s.Beta Was this translation helpful? Give feedback.
All reactions