From f4b4ada306ea51ef28502ec78b174b0370aa4d78 Mon Sep 17 00:00:00 2001 From: Treston Cuzzort Date: Mon, 26 Oct 2026 00:03:17 -0500 Subject: [PATCH] Make the space-optimized adaptor header self-contained 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. --- include/boost/circular_buffer/space_optimized.hpp | 6 ++++++ test/space_optimized_test.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/include/boost/circular_buffer/space_optimized.hpp b/include/boost/circular_buffer/space_optimized.hpp index 21681fd3..7c7a17bb 100644 --- a/include/boost/circular_buffer/space_optimized.hpp +++ b/include/boost/circular_buffer/space_optimized.hpp @@ -8,6 +8,12 @@ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// Include the main header before this file's guard so it can include this file +// while the internal configuration macros are still defined. +#if !defined(BOOST_CIRCULAR_BUFFER_HPP) +#include +#endif + #if !defined(BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP) #define BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP diff --git a/test/space_optimized_test.cpp b/test/space_optimized_test.cpp index 8694fcdb..0bf3751b 100644 --- a/test/space_optimized_test.cpp +++ b/test/space_optimized_test.cpp @@ -6,6 +6,9 @@ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// Include the adaptor header first to check that it is self-contained. +#define BOOST_CB_TEST +#include #include "test.hpp" #define CB_CONTAINER circular_buffer_space_optimized