From 8a6290b12f6b5b58ae7cc1e3543888f170cff78b Mon Sep 17 00:00:00 2001 From: gteubl Date: Fri, 18 Mar 2022 08:01:37 +0100 Subject: [PATCH] Fix CS0034 in Capacity method of std::vector --- Lib/csharp/std_vector.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/csharp/std_vector.i b/Lib/csharp/std_vector.i index e2811290c..ecb10dfbb 100644 --- a/Lib/csharp/std_vector.i +++ b/Lib/csharp/std_vector.i @@ -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); }