Removed allocator from constructors.

Added copy constructors to stack/queue.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9780 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-05-06 05:54:48 +00:00
commit 8622de7595
8 changed files with 45 additions and 49 deletions

View file

@ -114,7 +114,7 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<_Key, _Tp, _Compare, _Alloc >);
map( const _Compare&, const _Alloc& a = allocator_type() );
map( const _Compare& );
#ifdef %swig_map_methods
// Add swig/language extra methods

View file

@ -75,7 +75,7 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<_Key, _Tp, _Compare, _Alloc >);
multimap( const _Compare&, const _Alloc& a = allocator_type() );
multimap( const _Compare& );
#ifdef %swig_multimap_methods
// Add swig/language extra methods

View file

@ -71,7 +71,7 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >);
multiset( const _Compare&, const _Alloc& a = allocator_type() );
multiset( const _Compare& );
#ifdef %swig_multiset_methods
// Add swig/language extra methods

View file

@ -12,6 +12,9 @@
// Queue
%define %std_queue_methods(queue...)
queue();
queue( const _Sequence& );
bool empty() const;
size_type size() const;
const value_type& front() const;
@ -54,25 +57,22 @@
namespace std {
template<class _Tp, class _Alloc = allocator<_Tp> >
template<class _Tp, class _Sequence = std::deque<_Tp> >
class queue {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef _Alloc allocator_type;
typedef _Sequence container_type;
%traits_swigtype(_Tp);
%fragment(SWIG_Traits_frag(std::queue<_Tp, _Alloc >), "header",
%fragment(SWIG_Traits_frag(std::queue<_Tp, _Sequence >), "header",
fragment=SWIG_Traits_frag(_Tp),
fragment="StdQueueTraits") {
namespace swig {
template <> struct traits<std::queue<_Tp, _Alloc > > {
template <> struct traits<std::queue<_Tp, _Sequence > > {
typedef pointer_category category;
static const char* type_name() {
return "std::queue<" #_Tp " >";
@ -81,35 +81,32 @@ namespace std {
}
}
%typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp, _Alloc >);
%typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp, _Sequence >);
#ifdef %swig_queue_methods
// Add swig/language extra methods
%swig_queue_methods(std::queue<_Tp, _Alloc >);
%swig_queue_methods(std::queue<_Tp, _Sequence >);
#endif
%std_queue_methods(queue);
};
template<class _Tp, class _Alloc >
class queue<_Tp*, _Alloc > {
template<class _Tp, class _Sequence >
class queue<_Tp*, _Sequence > {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type reference;
typedef value_type const_reference;
typedef _Alloc allocator_type;
typedef _Tp value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef _Sequence container_type;
%traits_swigtype(_Tp);
%fragment(SWIG_Traits_frag(std::queue<_Tp*, _Alloc >), "header",
%fragment(SWIG_Traits_frag(std::queue<_Tp*, _Sequence >), "header",
fragment=SWIG_Traits_frag(_Tp),
fragment="StdQueueTraits") {
namespace swig {
template <> struct traits<std::queue<_Tp*, _Alloc > > {
template <> struct traits<std::queue<_Tp*, _Sequence > > {
typedef value_category category;
static const char* type_name() {
return "std::queue<" #_Tp " * >";
@ -118,14 +115,14 @@ namespace std {
}
}
%typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp*, _Alloc >);
%typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp*, _Sequence >);
#ifdef %swig_queue_methods_val
// Add swig/language extra methods
%swig_queue_methods_val(std::queue<_Tp*, _Alloc >);
%swig_queue_methods_val(std::queue<_Tp*, _Sequence >);
#endif
%std_queue_methods_val(std::queue<_Tp*, _Alloc >);
%std_queue_methods_val(std::queue<_Tp*, _Sequence >);
};
}

View file

@ -91,7 +91,7 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<_Key, _Compare, _Alloc >);
set( const _Compare&, const _Alloc& a = allocator_type() );
set( const _Compare& );
#ifdef %swig_set_methods
// Add swig/language extra methods

View file

@ -12,6 +12,9 @@
// Stack
%define %std_stack_methods(stack...)
stack();
stack( const _Sequence& );
bool empty() const;
size_type size() const;
const value_type& top() const;
@ -53,25 +56,22 @@
namespace std {
template<class _Tp, class _Alloc = allocator<_Tp> >
template<class _Tp, class _Sequence = std::deque<_Tp> >
class stack {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef _Alloc allocator_type;
typedef _Sequence container_type;
%traits_swigtype(_Tp);
%fragment(SWIG_Traits_frag(std::stack<_Tp, _Alloc >), "header",
%fragment(SWIG_Traits_frag(std::stack<_Tp, _Sequence >), "header",
fragment=SWIG_Traits_frag(_Tp),
fragment="StdStackTraits") {
namespace swig {
template <> struct traits<std::stack<_Tp, _Alloc > > {
template <> struct traits<std::stack<_Tp, _Sequence > > {
typedef pointer_category category;
static const char* type_name() {
return "std::stack<" #_Tp " >";
@ -80,35 +80,32 @@ namespace std {
}
}
%typemap_traits_ptr(SWIG_TYPECHECK_STACK, std::stack<_Tp, _Alloc >);
%typemap_traits_ptr(SWIG_TYPECHECK_STACK, std::stack<_Tp, _Sequence >);
#ifdef %swig_stack_methods
// Add swig/language extra methods
%swig_stack_methods(std::stack<_Tp, _Alloc >);
%swig_stack_methods(std::stack<_Tp, _Sequence >);
#endif
%std_stack_methods(stack);
};
template<class _Tp, class _Alloc >
class stack<_Tp*, _Alloc > {
template<class _Tp, class _Sequence >
class stack<_Tp*, _Sequence > {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef _Sequence::value_type value_type;
typedef value_type reference;
typedef value_type const_reference;
typedef _Alloc allocator_type;
typedef _Sequence container_type;
%traits_swigtype(_Tp);
%fragment(SWIG_Traits_frag(std::stack<_Tp*, _Alloc >), "header",
%fragment(SWIG_Traits_frag(std::stack<_Tp*, _Sequence >), "header",
fragment=SWIG_Traits_frag(_Tp),
fragment="StdStackTraits") {
namespace swig {
template <> struct traits<std::stack<_Tp*, _Alloc > > {
template <> struct traits<std::stack<_Tp*, _Sequence > > {
typedef value_category category;
static const char* type_name() {
return "std::stack<" #_Tp " * >";
@ -117,14 +114,14 @@ namespace std {
}
}
%typemap_traits_ptr(SWIG_TYPECHECK_STACK, std::stack<_Tp*, _Alloc >);
%typemap_traits_ptr(SWIG_TYPECHECK_STACK, std::stack<_Tp*, _Sequence >);
#ifdef %swig_stack_methods_val
// Add swig/language extra methods
%swig_stack_methods_val(std::stack<_Tp*, _Alloc >);
%swig_stack_methods_val(std::stack<_Tp*, _Sequence >);
#endif
%std_stack_methods_val(std::stack<_Tp*, _Alloc >);
%std_stack_methods_val(std::stack<_Tp*, _Sequence >);
};
}