Why is std :: vector :: max_size () non-static?

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 .

+7
c ++ language-lawyer c ++ - standard-library
source share

No one has answered this question yet.

See similar questions:

6
Why std :: bitset :: size is non-static
6
std :: string :: max_size () as a static member

or similar:

23498
Why is processing a sorted array faster than processing an unsorted array?
2437
Why "use the std namespace;" considered bad practice?
2116
Why are stigment additions much faster in individual cycles than in a combined cycle?
1783
C ++ 11 introduced a standardized memory model. What does it mean? And how will this affect C ++ programming?
1675
Why is reading strings from stdin much slower in C ++ than Python?
1643
Why can templates be implemented only in the header file?
1518
Image Processing: Enhanced Coca-Cola Can Recognition Algorithm
1250
Replacing a 32-bit loop counter with 64-bit values ​​results in crazy performance deviations
696
How to convert std :: string to lowercase?
606
Combining two std :: vectors

All Articles