Merge pull request #2239 from igt-gteubl/csharp-capacity-cs0034

C#: Fix CS0034 in Capacity method of std::vector
This commit is contained in:
William S Fulton 2022-03-30 20:04:08 +01:00 • committed by GitHub
commit e4c972c328
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,7 @@
return (int)capacity();
}
set {
if (value < size())
if (value < 0 || ($typemap(cstype, size_t))value < size())
throw new global::System.ArgumentOutOfRangeException("Capacity");
reserve(($typemap(cstype, size_t))value);
}