Skip to content

Make the space-optimized adaptor header self-contained - #55

Open
trestoncuzzort wants to merge 1 commit into
boostorg:developfrom
trestoncuzzort:self-contained-space-optimized
Open

trestoncuzzort wants to merge 1 commit into
boostorg:developfrom
trestoncuzzort:self-contained-space-optimized

Conversation

@trestoncuzzort

Copy link
Copy Markdown

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:

  • GCC 16.2.1: the full B2 test target passes in C++03 and C++17, including normal/debug adaptor tests: 12 runtime executions and the C++17 benchmark compile check. The benchmark's C++03 configuration is disabled by its Boost.Atomic/Chrono dependencies' C++11 requirements.
  • 32 additional GCC include-order checks pass with -Wall -Wextra -Werror, covering all six permutations of the forward/main/adaptor headers, direct and repeated inclusion, both language modes and both debug settings.
  • Clang 23: direct-header compile/run checks pass in both language modes and debug settings with -Wall -Wextra -Werror.
  • git diff --check passes. Windows was not run locally.

OpenAI Codex assisted with investigation, implementation and verification.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

boost/circular_buffer/space_optimized.hpp is not self-contained

1 participant