Lingxi
Lingxi

Reputation: 14977

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

Since the maximum size does not depend on particular std::vector objects, I guess it should be a static method. But still, the standard prototypes it as non-static, and I cannot figure out why. Logically, one should check the maximum size before creating any std::vector objects.

Note that this question is different from this one which is basically about constexpr.

Upvotes: 8

Views: 124

Answers (0)

Related Questions