From 88a76de9fe3f80331af84ee9d00cf6649b1fbdf3 Mon Sep 17 00:00:00 2001 From: Takashi Tamura Date: Sun, 29 Jan 2017 09:47:18 +0900 Subject: [PATCH] use %std_container_methods_without_reverse_iterators --- Lib/std/std_container.i | 10 ++++++---- Lib/std/std_unordered_map.i | 4 +--- Lib/std/std_unordered_multimap.i | 2 -- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Lib/std/std_container.i b/Lib/std/std_container.i index 5d0f1f545..000163f1e 100644 --- a/Lib/std/std_container.i +++ b/Lib/std/std_container.i @@ -26,17 +26,19 @@ class const_iterator; iterator begin(); iterator end(); + #endif - #if !defined(SWIG_NO_REVERSE_ITERATOR_METHODS) +%enddef + +%define %std_container_methods_reverse_iterators(container...) + + #ifdef SWIG_EXPORT_ITERATOR_METHODS class reverse_iterator; class const_reverse_iterator; reverse_iterator rbegin(); reverse_iterator rend(); #endif - #endif - - %enddef // Common container methods diff --git a/Lib/std/std_unordered_map.i b/Lib/std/std_unordered_map.i index 4795120d1..9212eab46 100644 --- a/Lib/std/std_unordered_map.i +++ b/Lib/std/std_unordered_map.i @@ -4,12 +4,11 @@ // operator--() and constructor(compare function) not available for unordered_ // types // -#define SWIG_NO_REVERSE_ITERATOR_METHODS %include %include %define %std_unordered_map_methods_common(unordered_map...) - %std_container_methods(unordered_map); + %std_container_methods_without_reverse_iterators(unordered_map); size_type erase(const key_type& x); size_type count(const key_type& x) const; @@ -123,4 +122,3 @@ namespace std { }; } -#undef SWIG_NO_REVERSE_ITERATOR_METHODS diff --git a/Lib/std/std_unordered_multimap.i b/Lib/std/std_unordered_multimap.i index 8feab03a4..41520d42d 100644 --- a/Lib/std/std_unordered_multimap.i +++ b/Lib/std/std_unordered_multimap.i @@ -6,7 +6,6 @@ // %include -#define SWIG_NO_REVERSE_ITERATOR_METHODS %define %std_unordered_multimap_methods(mmap...) %std_unordered_map_methods_common(mmap); @@ -86,4 +85,3 @@ namespace std { %std_unordered_multimap_methods(unordered_multimap); }; } -#undef SWIG_NO_REVERSE_ITERATOR_METHODS