From e3f6dc44ad751e4c49a8776fd20d76aa3809bac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Thu, 14 Nov 2019 23:36:05 +0100 Subject: [PATCH] Fixes #127 ("Fix docs for static_vector::max_size() and capacity()") --- doc/container.qbk | 1 + include/boost/container/static_vector.hpp | 46 +++++++++++++---------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/doc/container.qbk b/doc/container.qbk index 68324ab..7ff3b0d 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -1322,6 +1322,7 @@ use [*Boost.Container]? There are several reasons for that: [section:release_notes_boost_1_72_00 Boost 1.72 Release] * Fixed bugs: + * [@https://github.com/boostorg/container/issues/127 GitHub #127: ['"Fix docs for static_vector::max_size() and capacity()"]]. * [@https://github.com/boostorg/container/issues/132 GitHub #132: ['"flat_map::lower_bound and upper_bound have wrong/misleading docs"]]. * [@https://github.com/boostorg/container/issues/133 GitHub #133: ['"basic_string move constructor with allocator argument has incorrect allocator check"]]. diff --git a/include/boost/container/static_vector.hpp b/include/boost/container/static_vector.hpp index 2c08be8..6408c22 100644 --- a/include/boost/container/static_vector.hpp +++ b/include/boost/container/static_vector.hpp @@ -1116,27 +1116,33 @@ public: //! Constant O(1). const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW; - //! @brief Returns container's capacity. - //! - //! @return container's capacity. - //! - //! @par Throws - //! Nothing. - //! - //! @par Complexity - //! Constant O(1). - static size_type capacity() BOOST_NOEXCEPT_OR_NOTHROW; + #endif //#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED - //! @brief Returns container's capacity. - //! - //! @return container's capacity. - //! - //! @par Throws - //! Nothing. - //! - //! @par Complexity - //! Constant O(1). - static size_type max_size() BOOST_NOEXCEPT_OR_NOTHROW; + //! @brief Returns container's capacity. + //! + //! @return container's capacity. + //! + //! @par Throws + //! Nothing. + //! + //! @par Complexity + //! Constant O(1). + BOOST_CONTAINER_FORCEINLINE static size_type capacity() BOOST_NOEXCEPT_OR_NOTHROW + { return static_capacity; } + + //! @brief Returns container's capacity. + //! + //! @return container's capacity. + //! + //! @par Throws + //! Nothing. + //! + //! @par Complexity + //! Constant O(1). + BOOST_CONTAINER_FORCEINLINE static size_type max_size() BOOST_NOEXCEPT_OR_NOTHROW + { return static_capacity; } + + #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED //! @brief Returns the number of stored elements. //!