Skip to content

Commit f9ce804

Browse files
committed
Rename construction macros in std containers
1 parent 692c047 commit f9ce804

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

Lib/fortran/std_multiset.i

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77

88
%include "std_set.i"
99

10+
%define %swig_std_multiset(_Key, _Compare, _Alloc)
11+
%swig_std_setcommon(multiset, _Key, _Compare, _Alloc)
12+
%enddef
13+
1014
namespace std {
1115
template<class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> >
1216
class multiset {
13-
SWIG_STD_SET_COMMON(multiset, _Key, _Compare, _Alloc)
17+
%swig_std_multiset( _Key, _Compare, _Alloc)
1418
};
1519
} // end namespace std
1620

Lib/fortran/std_set.i

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
#include <set>
99
%}
1010

11-
%define SWIG_STD_SET_COMMON(CLASS, _Key, _Compare, _Alloc)
11+
// methods used by both set *and* multiset
12+
%define %swig_std_setcommon(CLASS, _Key, _Compare, _Alloc)
1213

1314
public:
1415
// Typedefs
@@ -37,13 +38,16 @@ public:
3738
size_type erase(const key_type& x);
3839
size_type count(const key_type& x) const;
3940
void insert(const_reference x);
41+
%enddef
4042

43+
%define %swig_std_set(_Key, _Compare, _Alloc)
44+
%swig_std_setcommon(set, _Key, _Compare, _Alloc)
4145
%enddef
4246

4347
namespace std {
4448
template<class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> >
4549
class set {
46-
SWIG_STD_SET_COMMON(set, _Key, _Compare, _Alloc)
50+
%swig_std_set(_Key, _Compare, _Alloc)
4751
};
4852
} // end namespace std
4953

Lib/fortran/std_vector.i

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <vector>
2121
%}
2222

23-
%define SWIG_STD_VECTOR_COMMON(CTYPE, CREF_TYPE)
23+
%define %swig_std_vector(CTYPE, CREF_TYPE)
2424
public:
2525
// Typedefs
2626
typedef size_t size_type;
@@ -109,7 +109,7 @@
109109
}
110110
%enddef
111111

112-
%define SWIG_STD_VECTOR_REF(CTYPE)
112+
%define %swig_std_vector_extend_ref(CTYPE)
113113
%extend {
114114
CTYPE& front_ref() {
115115
return (*$self).front();
@@ -128,13 +128,13 @@
128128

129129
namespace std {
130130
template<class T> class vector {
131-
SWIG_STD_VECTOR_COMMON(T, const T&)
132-
SWIG_STD_VECTOR_REF(T)
131+
%swig_std_vector(T, const T&)
132+
%swig_std_vector_extend_ref(T)
133133
};
134134

135135
// bool specialization
136136
template<> class vector<bool> {
137-
SWIG_STD_VECTOR_COMMON(bool, bool)
137+
%swig_std_vector(bool, bool)
138138
};
139139
} // end namespace std
140140

0 commit comments

Comments
 (0)