File tree Expand file tree Collapse file tree 2 files changed +18
-39
lines changed Expand file tree Collapse file tree 2 files changed +18
-39
lines changed Original file line number Diff line number Diff line change 5
5
* keys.
6
6
* ------------------------------------------------------------------------- */
7
7
8
- %include " std_common.i"
9
-
10
- %{
11
- #include < set>
12
- %}
13
-
14
- %fortransubroutine std::multiset::erase;
8
+ %include " std_set.i"
15
9
16
10
namespace std {
17
-
18
11
template <class _Key , class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> >
19
12
class multiset {
20
- public:
21
- typedef _Key value_type;
22
- typedef _Key key_type;
23
- typedef std::size_t size_type;
24
- typedef ptrdiff_t difference_type;
25
- typedef value_type *pointer;
26
- typedef const value_type *const_pointer;
27
- typedef value_type &reference;
28
- typedef const value_type &const_reference;
29
- typedef _Alloc allocator_type;
30
-
31
- public:
32
- set ();
33
-
34
- // - Use native Fortran integers in proxy code
35
- %apply int FORTRAN_INT {size_type};
36
-
37
- bool empty () const ;
38
- size_type size () const ;
39
- void clear ();
40
- size_type erase (const key_type& x);
41
- size_type count (const key_type& x) const ;
42
- void insert (const_reference x);
13
+ SWIG_STD_SET_COMMON (multiset, _Key, _Compare, _Alloc)
43
14
};
44
- } // namespace std
15
+ } // end namespace std
16
+
45
17
Original file line number Diff line number Diff line change 8
8
#include < set>
9
9
%}
10
10
11
- %fortransubroutine std::set::erase;
11
+ %define SWIG_STD_SET_COMMON (CLASS, _Key, _Compare, _Alloc)
12
12
13
- namespace std {
14
-
15
- template <class _Key , class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> >
16
- class set {
17
13
public:
14
+ // Typedefs
18
15
typedef _Key value_type;
19
16
typedef _Key key_type;
20
17
typedef std::size_t size_type;
@@ -26,17 +23,27 @@ public:
26
23
typedef _Alloc allocator_type;
27
24
28
25
public:
29
- set ();
26
+ CLASS ();
30
27
31
28
// - Use native Fortran integers in proxy code
32
29
%apply int FORTRAN_INT {size_type};
33
30
34
31
bool empty () const ;
35
32
size_type size () const ;
36
33
void clear ();
34
+
35
+ %fortransubroutine erase;
36
+
37
37
size_type erase (const key_type& x);
38
38
size_type count (const key_type& x) const ;
39
39
void insert (const_reference x);
40
+
41
+ %enddef
42
+
43
+ namespace std {
44
+ template <class _Key , class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> >
45
+ class set {
46
+ SWIG_STD_SET_COMMON (set, _Key, _Compare, _Alloc)
40
47
};
48
+ } // end namespace std
41
49
42
- } // namespace std
You can’t perform that action at this time.
0 commit comments