using new template resolution for def args, and cosmetics

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6890 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-12-16 01:35:52 +00:00
commit bd0ccd3769
14 changed files with 58 additions and 63 deletions

View file

@ -9,7 +9,7 @@
namespace std { namespace std {
template <class _CharT, class _Traits = std::char_traits<_CharT>, typename _Alloc = std::allocator<_CharT> > template <class _CharT, class _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> >
class basic_string class basic_string
{ {
#if !defined(SWIG_STD_MODERN_STL) || defined(SWIG_STD_NOMODERN_STL) #if !defined(SWIG_STD_MODERN_STL) || defined(SWIG_STD_NOMODERN_STL)

View file

@ -49,7 +49,7 @@
namespace std { namespace std {
template<class _Tp, class _Alloc = std::allocator<_Tp> > template<class _Tp, class _Alloc = allocator<_Tp> >
class deque { class deque {
public: public:
typedef size_t size_type; typedef size_t size_type;

View file

@ -247,8 +247,8 @@ namespace std {
} }
namespace std { namespace std {
%template(ios) basic_ios<char, std::char_traits<char> >; %template(ios) basic_ios<char>;
%template(wios) basic_ios<wchar_t, std::char_traits<wchar_t> >; %template(wios) basic_ios<wchar_t>;
} }

View file

@ -77,8 +77,6 @@ namespace std
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&
operator<<(unsigned long long __n); operator<<(unsigned long long __n);
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&
operator<<(double __f); operator<<(double __f);
@ -88,7 +86,6 @@ namespace std
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&
operator<<(long double __f); operator<<(long double __f);
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&
operator<<(const void* __p); operator<<(const void* __p);
@ -279,23 +276,23 @@ namespace std
~basic_iostream(); ~basic_iostream();
}; };
typedef basic_ostream<char, std::char_traits<char> > ostream ; typedef basic_ostream<char> ostream ;
typedef basic_istream<char, std::char_traits<char> > istream; typedef basic_istream<char> istream;
typedef basic_iostream<char, std::char_traits<char> > iostream; typedef basic_iostream<char> iostream;
typedef basic_ostream<wchar_t, std::char_traits<wchar_t> > wostream; typedef basic_ostream<wchar_t> wostream;
typedef basic_istream<wchar_t, std::char_traits<wchar_t> > wistream; typedef basic_istream<wchar_t> wistream;
typedef basic_iostream<wchar_t, std::char_traits<wchar_t> > wiostream; typedef basic_iostream<wchar_t> wiostream;
extern std::istream cin; extern istream cin;
extern std::ostream cout; extern ostream cout;
extern std::ostream cerr; extern ostream cerr;
extern std::ostream clog; extern ostream clog;
extern std::wistream wcin; extern wistream wcin;
extern std::wostream wcout; extern wostream wcout;
extern std::wostream wcerr; extern wostream wcerr;
extern std::wostream wclog; extern wostream wclog;
template<typename _CharT, typename _Traits = char_traits<_CharT> > template<typename _CharT, typename _Traits = char_traits<_CharT> >
std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>&
@ -311,13 +308,13 @@ namespace std
} }
namespace std { namespace std {
%template(ostream) basic_ostream<char, std::char_traits<char> >; %template(ostream) basic_ostream<char>;
%template(istream) basic_istream<char, std::char_traits<char> >; %template(istream) basic_istream<char>;
%template(iostream) basic_iostream<char, std::char_traits<char> >; %template(iostream) basic_iostream<char>;
%template(wostream) basic_ostream<wchar_t, std::char_traits<wchar_t> >; %template(wostream) basic_ostream<wchar_t>;
%template(wistream) basic_istream<wchar_t, std::char_traits<wchar_t> >; %template(wistream) basic_istream<wchar_t>;
%template(wiostream) basic_iostream<wchar_t, std::char_traits<wchar_t> >; %template(wiostream) basic_iostream<wchar_t>;
%template(endl) endl<char, std::char_traits<char> >; %template(endl) endl<char, std::char_traits<char> >;
%template(ends) ends<char, std::char_traits<char> >; %template(ends) ends<char, std::char_traits<char> >;

View file

@ -61,7 +61,7 @@
namespace std { namespace std {
template<class _Tp, class _Alloc = std::allocator<_Tp> > template<class _Tp, class _Alloc = allocator<_Tp> >
class list { class list {
public: public:
typedef size_t size_type; typedef size_t size_type;

View file

@ -81,7 +81,7 @@
namespace std { namespace std {
template<class _Key, class _Tp, class _Compare = std::less<_Key >, template<class _Key, class _Tp, class _Compare = std::less<_Key >,
class _Alloc = std::allocator<std::pair<const _Key, _Tp > > > class _Alloc = allocator<std::pair<const _Key, _Tp > > >
class map { class map {
public: public:
typedef size_t size_type; typedef size_t size_type;

View file

@ -43,7 +43,7 @@
namespace std { namespace std {
template<class _Key, class _Tp, class _Compare = std::less<_Key >, template<class _Key, class _Tp, class _Compare = std::less<_Key >,
class _Alloc = std::allocator<std::pair<const _Key, _Tp > > > class _Alloc = allocator<std::pair<const _Key, _Tp > > >
class multimap { class multimap {
public: public:
typedef size_t size_type; typedef size_t size_type;

View file

@ -43,7 +43,7 @@ namespace std {
//multiset //multiset
template <class _Key, class _Compare = less<_Key>, template <class _Key, class _Compare = std::less<_Key>,
class _Alloc = allocator<_Key> > class _Alloc = allocator<_Key> >
class multiset { class multiset {
public: public:

View file

@ -64,7 +64,7 @@
namespace std { namespace std {
template <class _Key, class _Compare = less<_Key>, template <class _Key, class _Compare = std::less<_Key>,
class _Alloc = allocator<_Key> > class _Alloc = allocator<_Key> >
class set { class set {
public: public:

View file

@ -33,15 +33,15 @@ namespace std
basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out); basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out);
explicit explicit
basic_stringbuf(const basic_string<char_type, _Traits, _Alloc>& __str, basic_stringbuf(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __mode = ios_base::in | ios_base::out); ios_base::openmode __mode = ios_base::in | ios_base::out);
// Get and set: // Get and set:
basic_string<char_type, _Traits, _Alloc> basic_string<_CharT, _Traits, _Alloc>
str() const; str() const;
void void
str(const basic_string<char_type, _Traits, _Alloc>& __s); str(const basic_string<_CharT, _Traits, _Alloc>& __s);
}; };
@ -68,7 +68,7 @@ namespace std
basic_istringstream(ios_base::openmode __mode = ios_base::in); basic_istringstream(ios_base::openmode __mode = ios_base::in);
explicit explicit
basic_istringstream(const basic_string<char_type, _Traits, _Alloc>& __str, basic_istringstream(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __mode = ios_base::in); ios_base::openmode __mode = ios_base::in);
~basic_istringstream(); ~basic_istringstream();
@ -77,11 +77,11 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>* basic_stringbuf<_CharT, _Traits, _Alloc>*
rdbuf() const; rdbuf() const;
basic_string<char_type, _Traits, _Alloc> basic_string<_CharT, _Traits, _Alloc>
str() const; str() const;
void void
str(const basic_string<char_type, _Traits, _Alloc>& __s); str(const basic_string<_CharT, _Traits, _Alloc>& __s);
}; };
@ -107,7 +107,7 @@ namespace std
basic_ostringstream(ios_base::openmode __mode = ios_base::out); basic_ostringstream(ios_base::openmode __mode = ios_base::out);
explicit explicit
basic_ostringstream(const basic_string<char_type, _Traits, _Alloc>& __str, basic_ostringstream(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __mode = ios_base::out); ios_base::openmode __mode = ios_base::out);
~basic_ostringstream(); ~basic_ostringstream();
@ -116,12 +116,12 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>* basic_stringbuf<_CharT, _Traits, _Alloc>*
rdbuf() const; rdbuf() const;
basic_string<char_type, _Traits, _Alloc> basic_string<_CharT, _Traits, _Alloc>
str() const; str() const;
#if 0 #if 0
void void
str(const basic_string<char_type, _Traits, _Alloc>& __s); str(const basic_string<_CharT, _Traits, _Alloc>& __s);
#endif #endif
}; };
@ -147,7 +147,7 @@ namespace std
basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in); basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in);
explicit explicit
basic_stringstream(const basic_string<char_type, _Traits, _Alloc>& __str, basic_stringstream(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __m = ios_base::out | ios_base::in); ios_base::openmode __m = ios_base::out | ios_base::in);
~basic_stringstream(); ~basic_stringstream();
@ -156,11 +156,11 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>* basic_stringbuf<_CharT, _Traits, _Alloc>*
rdbuf() const; rdbuf() const;
basic_string<char_type, _Traits, _Alloc> basic_string<_CharT, _Traits, _Alloc>
str() const; str() const;
void void
str(const basic_string<char_type, _Traits, _Alloc>& __s); str(const basic_string<_CharT, _Traits, _Alloc>& __s);
}; };
@ -168,12 +168,12 @@ namespace std
namespace std { namespace std {
%template(istringstream) basic_istringstream<char, char_traits<char>, allocator<char> >; %template(istringstream) basic_istringstream<char>;
%template(ostringstream) basic_ostringstream<char, char_traits<char>, allocator<char> >; %template(ostringstream) basic_ostringstream<char>;
%template(stringstream) basic_stringstream<char, char_traits<char>, allocator<char> >; %template(stringstream) basic_stringstream<char>;
%template(wistringstream) basic_istringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >; %template(wistringstream) basic_istringstream<wchar_t>;
%template(wostringstream) basic_ostringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >; %template(wostringstream) basic_ostringstream<wchar_t>;
%template(wstringstream) basic_stringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >; %template(wstringstream) basic_stringstream<wchar_t>;
} }

View file

@ -5,7 +5,7 @@
namespace std { namespace std {
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_streambuf class basic_streambuf
{ {
public: public:
@ -16,8 +16,6 @@ namespace std {
typedef typename traits_type::pos_type pos_type; typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type; typedef typename traits_type::off_type off_type;
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
public: public:
virtual virtual
~basic_streambuf(); ~basic_streambuf();
@ -30,7 +28,7 @@ namespace std {
getloc() const; getloc() const;
// Buffer and positioning: // Buffer and positioning:
__streambuf_type* basic_streambuf<_CharT, _Traits>*
pubsetbuf(char_type* __s, streamsize __n); pubsetbuf(char_type* __s, streamsize __n);
pos_type pos_type
@ -82,6 +80,6 @@ namespace std {
} }
namespace std { namespace std {
%template(streambuf) basic_streambuf<char, char_traits<char> >; %template(streambuf) basic_streambuf<char>;
%template(wstreambuf) basic_streambuf<wchar_t, char_traits<wchar_t> >; %template(wstreambuf) basic_streambuf<wchar_t>;
} }

View file

@ -4,9 +4,9 @@
namespace std namespace std
{ {
%std_comp_methods(basic_string<char, std::char_traits<char>, std::allocator<char> >); %std_comp_methods(basic_string<char>);
typedef basic_string<char, std::char_traits<char>, std::allocator<char> > string; typedef basic_string<char> string;
} }
%template(string) std::basic_string<char, std::char_traits<char>, std::allocator<char> >; %template(string) std::basic_string<char>;

View file

@ -56,7 +56,7 @@
namespace std { namespace std {
template<class _Tp, class _Alloc = std::allocator< _Tp > > template<class _Tp, class _Alloc = allocator< _Tp > >
class vector { class vector {
public: public:
typedef size_t size_type; typedef size_t size_type;

View file

@ -9,8 +9,8 @@
namespace std namespace std
{ {
%std_comp_methods(basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >); %std_comp_methods(basic_string<wchar_t>);
typedef basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > wstring; typedef basic_string<wchar_t> wstring;
} }
%template(wstring) std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >; %template(wstring) std::basic_string<wchar_t>;