fix Solaris/assign problem

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6184 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-08-31 20:33:39 +00:00
commit 7a5fdd5784
2 changed files with 17 additions and 0 deletions

View file

@ -8,6 +8,15 @@
//
//#define SWIG_STD_NOMODERN_STL
// Here, we identify compilers we now have problems with STL.
%{
#if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
#define SWIG_STD_NOASSIGN_STL
#endif
%}
//
// Define or uncomment the following macro to instantiate by default
// all the basic std typemaps (std::pair<T,U>, std::vector<T>, etc)

View file

@ -105,7 +105,15 @@
template <class PySeq, class Seq>
inline void
assign(const PySeq& pyseq, Seq* seq) {
#ifdef SWIG_STD_NOASSIGN_STL
typedef typename PySeq::value_type value_type;
typename PySeq::const_iterator it = pyseq.begin();
for (;it != pyseq.end(); ++it) {
seq->insert(seq->end(),(value_type)(*it));
}
#else
seq->assign(pyseq.begin(), pyseq.end());
#endif
}
template <class Seq, class T = typename Seq::value_type >