Skip to content
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

Add forward declarations for individual units #314

Merged
merged 3 commits into from
Oct 28, 2024
Merged

Conversation

chiphogg
Copy link
Contributor

Individual "au/units/*.hh" files still pull in some decently heavy
machinery. The sensible, scalable solution is to provide a
"au/units/*_fwd.hh" file corresponding to each of them. Each
"regular" units header will include its _fwd.hh header as the first
include (and we add a comment to that effect to prevent clang-format
from reordering them).

Happily, this enables us to write a somewhat meaningful test for the
forward declaraction machinery. We can now make a header file that
provides an interface with only the forward declarations. Then we call
that API inside of a test file.

Finally, this is worth updating the docs for:

  • Installation: mention the fwd.hh files.
  • Alternatives: mention this feature, as we're the first units
    library I know of that provides it.

All of these changes are in separate commits for the convenience of the
reviewer: I recommend starting at the first, and using n and p to
navigate them.

Fixes #232.

@chiphogg chiphogg added the release notes: ✨ lib (enhancement) PR enhancing the library code label Oct 28, 2024
Copy link
Contributor

@geoffviola geoffviola left a comment

Choose a reason for hiding this comment

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

Makes sense. Implementation, test, and documentation changes look good.

@chiphogg chiphogg merged commit 99c02d6 into main Oct 28, 2024
11 checks passed
@chiphogg chiphogg deleted the chiphogg/fwd-units#232 branch October 28, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: ✨ lib (enhancement) PR enhancing the library code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide forward declarations
2 participants