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:
parent
a7aa62ce68
commit
8622de7595
8 changed files with 45 additions and 49 deletions
|
|
@ -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 >);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue