From 03d4f4fef7cd2e8c85c2c50273797cec38c61b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Wed, 17 Dec 2025 23:39:27 +0100 Subject: [PATCH] Place better BOOST_CONTAINER_DOXYGEN_INVOKED checks so that doxygen does not generate unwanted types in the documentation --- doc/Jamfile.v2 | 4 +++- include/boost/container/allocator_traits.hpp | 4 ---- include/boost/container/flat_map.hpp | 8 ++++++-- include/boost/container/pmr/resource_adaptor.hpp | 4 ++++ include/boost/container/small_vector.hpp | 4 ++++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index d662aad..c4c01bb 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -49,11 +49,13 @@ doxygen autodoc \"BOOST_INTRUSIVE_OPTION_CONSTANT(OPTION_NAME, TYPE, VALUE, CONSTANT_NAME) = template struct OPTION_NAME{};\" \\ \"BOOST_INTRUSIVE_OPTION_TYPE(OPTION_NAME, TYPE, TYPEDEF_EXPR, TYPEDEF_NAME) = template struct OPTION_NAME{};\" \\ \"BOOST_CONTAINER_DOC1ST(T1, T2)=T1\" \\ - \"BOOST_CONTAINER_DOCIGN(T) \"\\ + \"BOOST_CONTAINER_DOCIGN(T)= \"\\ \"BOOST_CONTAINER_DOCONLY(T)=T\"\\ \"BOOST_CONTAINER_SCOPEDALLOC_DUMMYTRUE=\"\\ \"BOOST_CONTAINER_SCOPEDALLOC_ALLINNER=InnerAllocs...\"\\ + \"BOOST_CONTAINER_SCOPEDALLOC_ALLINNERCLASS=typename... InnerAllocs\"\\ \"BOOST_CONTAINER_DECL=\"\\ + \"BOOST_CONTAINER_CONSTANT_VAR=static constexpr \"\\ \"BOOST_CONTAINER_FORCEINLINE=inline\" \\ " "boost.doxygen.reftitle=Boost.Container Header Reference" diff --git a/include/boost/container/allocator_traits.hpp b/include/boost/container/allocator_traits.hpp index 95b1fa3..7aad7b1 100644 --- a/include/boost/container/allocator_traits.hpp +++ b/include/boost/container/allocator_traits.hpp @@ -80,8 +80,6 @@ #pragma GCC diagnostic pop #endif -#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED - namespace boost { namespace container { namespace dtl { @@ -194,8 +192,6 @@ construct_type(T* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y) } //namespace dtl -#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED - template class small_vector_allocator; diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index 1c8ff93..802d532 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -49,6 +49,8 @@ #include #endif +#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE #endif @@ -64,6 +66,8 @@ #pragma GCC optimize("no-strict-aliasing") #endif +#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + namespace boost { namespace container { @@ -87,7 +91,7 @@ template BOOST_CONTAINER_FORCEINLINE static D force_copy(D s) { return s; } -#else //!BOOST_CONTAINER_DOXYGEN_INVOKED +#else //!BOOST_CONTAINER_STD_PAIR_IS_MOVABLE template BOOST_CONTAINER_FORCEINLINE static D &force(S &s) @@ -104,7 +108,7 @@ BOOST_CONTAINER_FORCEINLINE static D force_copy(const S &s) D ret_val(*vp); return ret_val; } -#endif //BOOST_CONTAINER_DOXYGEN_INVOKED +#endif //BOOST_CONTAINER_STD_PAIR_IS_MOVABLE } //namespace dtl{ diff --git a/include/boost/container/pmr/resource_adaptor.hpp b/include/boost/container/pmr/resource_adaptor.hpp index e53a720..b21cf59 100644 --- a/include/boost/container/pmr/resource_adaptor.hpp +++ b/include/boost/container/pmr/resource_adaptor.hpp @@ -31,6 +31,8 @@ namespace boost { namespace container { +#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + namespace pmr_dtl { template @@ -53,6 +55,8 @@ struct max_allocator_alignment< std::allocator > } //namespace pmr_dtl +#endif //BOOST_CONTAINER_DOXYGEN_INVOKED + namespace pmr { //! An instance of resource_adaptor is an adaptor that wraps a memory_resource interface diff --git a/include/boost/container/small_vector.hpp b/include/boost/container/small_vector.hpp index f80249f..7a5efd3 100644 --- a/include/boost/container/small_vector.hpp +++ b/include/boost/container/small_vector.hpp @@ -47,6 +47,8 @@ #include //offsetof +#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + namespace boost { namespace container { @@ -316,6 +318,8 @@ struct small_vector_storage BOOST_STATIC_CONSTEXPR std::size_t sms_size = 0u; }; +#endif //BOOST_CONTAINER_DOXYGEN_INVOKED + //! This class consists of common code from all small_vector types that don't depend on the //! "N" template parameter. This class is non-copyable and non-destructible, so this class typically //! used as reference argument to functions that read or write small vectors. Since `small_vector`