Add missing typedefs to std::list + typedef corrections
Numerous missing typedefs added. std::list<T*>::const_reference and std::list<T*>::reference specialization typedef fixes.
This commit is contained in:
parent
e26f6bb4e2
commit
440264e479
6 changed files with 39 additions and 32 deletions
|
|
@ -28,12 +28,16 @@ namespace std{
|
|||
template<class T> class list
|
||||
{
|
||||
public:
|
||||
|
||||
typedef T &reference;
|
||||
typedef const T& const_reference;
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef T &iterator;
|
||||
typedef const T& const_iterator;
|
||||
|
||||
|
||||
list();
|
||||
list(unsigned int size, const T& value = T());
|
||||
list(const list<T> &other);
|
||||
|
|
@ -46,21 +50,20 @@ namespace std{
|
|||
const_reference back();
|
||||
const_iterator begin();
|
||||
const_iterator end();
|
||||
|
||||
|
||||
void resize(unsigned int n, T c = T());
|
||||
bool empty() const;
|
||||
|
||||
void push_front(const T& INPUT);
|
||||
void push_back(const T& INPUT);
|
||||
|
||||
|
||||
void pop_front();
|
||||
void pop_back();
|
||||
void clear();
|
||||
unsigned int size() const;
|
||||
unsigned int max_size() const;
|
||||
void resize(unsigned int n, const T& INPUT);
|
||||
|
||||
|
||||
void remove(const T& INPUT);
|
||||
void unique();
|
||||
void reverse();
|
||||
|
|
@ -153,7 +156,7 @@ namespace std{
|
|||
if (j<0) j += size;
|
||||
if (i<0) i = 0;
|
||||
if (j>size) j = size;
|
||||
|
||||
|
||||
for (int k=0;k<i;k++)
|
||||
{
|
||||
first++;
|
||||
|
|
@ -174,7 +177,7 @@ namespace std{
|
|||
if (j<0) j += size;
|
||||
if (i<0) i = 0;
|
||||
if (j>size) j = size;
|
||||
|
||||
|
||||
for (int k=0;k<i;k++)
|
||||
{
|
||||
first++;
|
||||
|
|
@ -200,7 +203,6 @@ namespace std{
|
|||
}
|
||||
else self->insert(self->end(),v.begin(),v.end());
|
||||
}
|
||||
|
||||
}
|
||||
unsigned int __len__()
|
||||
{
|
||||
|
|
@ -218,8 +220,7 @@ namespace std{
|
|||
{
|
||||
self->pop_back();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* std_vector.i
|
||||
* std_list.i
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%{
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace std {
|
||||
|
||||
template<class T, class Alloc = allocator<T> >
|
||||
template<class T>
|
||||
class list {
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
|
|
@ -19,7 +19,6 @@ namespace std {
|
|||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef Alloc allocator_type;
|
||||
|
||||
list();
|
||||
size_type size() const;
|
||||
|
|
|
|||
|
|
@ -130,8 +130,12 @@ namespace std {
|
|||
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef T &reference;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
|
||||
/*
|
||||
* We'd actually be better off having the nested class *not* be static in the wrapper
|
||||
|
|
|
|||
|
|
@ -13,16 +13,20 @@
|
|||
%}
|
||||
|
||||
|
||||
namespace std{
|
||||
namespace std {
|
||||
template<class T> class list
|
||||
{
|
||||
public:
|
||||
|
||||
typedef T &reference;
|
||||
typedef const T& const_reference;
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef T &iterator;
|
||||
typedef const T& const_iterator;
|
||||
|
||||
|
||||
list();
|
||||
list(unsigned int size, const T& value = T());
|
||||
list(const list<T>& other);
|
||||
|
|
@ -35,28 +39,25 @@ namespace std{
|
|||
const_reference back();
|
||||
const_iterator begin();
|
||||
const_iterator end();
|
||||
|
||||
|
||||
void resize(unsigned int n, T c = T());
|
||||
bool empty() const;
|
||||
|
||||
void push_front(const T& x);
|
||||
void push_back(const T& x);
|
||||
|
||||
|
||||
void pop_front();
|
||||
void pop_back();
|
||||
void clear();
|
||||
unsigned int size() const;
|
||||
unsigned int max_size() const;
|
||||
void resize(unsigned int n, const T& value);
|
||||
|
||||
|
||||
void remove(const T& value);
|
||||
void unique();
|
||||
void reverse();
|
||||
void sort();
|
||||
|
||||
|
||||
|
||||
|
||||
%extend
|
||||
{
|
||||
const_reference __getitem__(int i) throw (std::out_of_range)
|
||||
|
|
@ -206,9 +207,7 @@ namespace std{
|
|||
{
|
||||
self->pop_back();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,11 @@ namespace std {
|
|||
}
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
|
||||
list();
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@ namespace std {
|
|||
typedef _Tp* value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
typedef value_type reference;
|
||||
typedef value_type const_reference;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef _Alloc allocator_type;
|
||||
|
||||
%traits_swigtype(_Tp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue