Since the maximum size does not depend on specific std::vector objects, I think it should be a static method. But still standard prototypes are non-static, and I canβt understand why. It is logical that before creating any std::vector objects, you need to check the maximum size.
Note that this question differs from this in that it mainly refers to constexpr .
c ++ language-lawyer c ++ - standard-library
Lingxi
source share