Reputation: 20756
I mean something like this:
std::vector<T> v(0);
Is it ok? I don't see any requirements like this in the Standard.
Upvotes: 3
Views: 61
Reputation: 119382
This is well-defined. The standard does not place any restrictions on the value of n
passed to this constructor. 0
is a valid value of type size_type
(whatever that is).
Upvotes: 6