diff options
Diffstat (limited to 'Lib/ocaml/std_map.i')
-rw-r--r-- | Lib/ocaml/std_map.i | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Lib/ocaml/std_map.i b/Lib/ocaml/std_map.i index 3f197baa6..b6a98c6e0 100644 --- a/Lib/ocaml/std_map.i +++ b/Lib/ocaml/std_map.i @@ -47,7 +47,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); @@ -63,17 +67,4 @@ namespace std { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } |