Closed Ukilele closed 2 years ago
I'm not sure that reserve() can be a no-op. what happens if you try to reserve more than there's capacity? it needs to fail.
Thanks for the report. Throwing on capacity exhaustion depends on the options used by the container (by default it throws when static capacity is exceeded) so the documentation should reflect this.
According to the documentation of static_vector, its member function
reserve
should benoexcept
. But in fact it is not. The documentation is probably generated from the function declaration at line 540. But this code is only defined when the macroBOOST_CONTAINER_DOXYGEN_INVOKED
is defined. When actually calling the function, the overload from the base class (boost::container::vector<...>
) gets called, which is defined in vector.hpp, line 1567.I would be willing to provide a pull request with a fix, but I am not sure what needs to be fixed. The first option would be to not mention
noexcept
in the documentation, i.e. remove theBOOST_NOEXCEPT_OR_NOTHROW
from line 540. The second option would be to move thereserve
-function at line 540 out of theBOOST_CONTAINER_DOXYGEN_INVOKED
-block and to always provide an actual definition of it.