From 1b47981f5ed9015fdaa2128d8b56c57c7a7bb9ad Mon Sep 17 00:00:00 2001 From: Treston Cuzzort Date: Mon, 26 Oct 2026 00:03:17 -0500 Subject: [PATCH 1/2] 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 From 37ada7a559dfd44bbe7c95519df70ffb74559ba4 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Wed, 2 Dec 2026 17:56:55 +1000 Subject: [PATCH 2/2] Comment refinement --- include/boost/circular_buffer/space_optimized.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/circular_buffer/space_optimized.hpp b/include/boost/circular_buffer/space_optimized.hpp index 7c7a17bb..b413e932 100644 --- a/include/boost/circular_buffer/space_optimized.hpp +++ b/include/boost/circular_buffer/space_optimized.hpp @@ -8,8 +8,7 @@ // 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. +// Via main circular_buffer include #if !defined(BOOST_CIRCULAR_BUFFER_HPP) #include #endif