-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. #2841
Conversation
This is what I currently have to do: https://github.com/rwgk/pybind11/blob/0e5d2d3a21e2607f0307bbe88e3603f263ebba27/include/pybind11/cast.h#L958 |
8f73169
to
28e6d79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see @wjakob was requested for review. That sounds like a good idea, indeed.
In general, this PR doesn't seem like a bad idea to me, though I'm slightly confused how it helps you on the other PR? Before, you would include pybind11/cast.h
, now you include pybind11/detail/type_caster_base.h
?
I'm generally in favor of more, smaller files with better separation. Makes it easier to refactor, find what you are looking for, include just the right part, etc. The correct includes should be places in each file, though. Ideally include-what-you-use style. |
Thanks @henryiii, will do. In the meantime I made more progress running all existing unit tests with the new |
28e6d79
to
3aee9aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks! :-) |
The first part of
cast.h
is moved todetail/type_caster_base.h
.The break point is the end of
class type_caster_base
.I believe breaking up the very large
cast.h
is a good step in its own right, but the immediate motivation is to help moving PR #2672 forward.Cleanup of includes was guided by
include-what-you-use 0.12 based on clang version 9.0.1-11
.The approach was ad-hoc but simple:
inline
functions were ignored. Resolving them probably needs refactoring of other files.patchlevel.h
) were ignored.std::
prefixes were added to avoid C-style includes.Changelog not needed.