diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-07-30 23:21:21 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-07-31 01:02:08 +0100 |
commit | ffbde7a13206a592dc26f3e9e36ce35289e7baee (patch) | |
tree | e89143ff8a33e6e3015b464a936ed8791153d7a7 /Lib/std | |
parent | 675c94c5758b56ce29c782d2319d1893702640a8 (diff) | |
download | swig-ffbde7a13206a592dc26f3e9e36ce35289e7baee.tar.gz |
Fixes for deprecated std::basic_string::reserve()
Diffstat (limited to 'Lib/std')
-rw-r--r-- | Lib/std/std_basic_string.i | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/std/std_basic_string.i b/Lib/std/std_basic_string.i index fb7afc1e6..e95cb4765 100644 --- a/Lib/std/std_basic_string.i +++ b/Lib/std/std_basic_string.i @@ -55,7 +55,16 @@ namespace std { size_type capacity() const; - void reserve(size_type __res_arg = 0); + void reserve(size_type __res_arg); + %extend { + void shrink_to_fit() { + %#if __cplusplus >= 202002L + self->shrink_to_fit(); + %#else + self->reserve(); + %#endif + } + } // Modifiers: |