Repository navigation
Make the space-optimized adaptor header self-contained - #55
trestoncuzzort wants to merge 1 commit into
Conversation
Include the main header before the adaptor guard so its internal macros remain defined while the adaptor is parsed. Include the adaptor header first in the existing test to cover standalone inclusion.
|
Thanks for the patch.
The other headers ( CauseThe sub-headers were written to be included only through
The docs make it worse: Suggested fixAt the top of both Placing it before the guard is what makes this work:
This keeps the existing design: the macros are still Alternative consideredMoving the macros into a shared internal header would mean dropping the VerificationThe fix was applied to a scratch copy and tested. All of these compile with zero
Including |
Fixes #48.
Including only
<boost/circular_buffer/space_optimized.hpp>fails because the adaptor's base class and configuration are not available. Include the main header before the adaptor's include guard. The placement lets the main header include the adaptor while its internal macros are still defined, before it undefines them at the end.Make the existing adaptor test include this header first, with the existing test hooks enabled. That test fails to compile against the original headers.
Validation:
-Wall -Wextra -Werror, covering all six permutations of the forward/main/adaptor headers, direct and repeated inclusion, both language modes and both debug settings.-Wall -Wextra -Werror.git diff --checkpasses. Windows was not run locally.OpenAI Codex assisted with investigation, implementation and verification.