diff --git a/SWIG/Lib/python/std_common.i b/SWIG/Lib/python/std_common.i index 4eaf8d108..97307b561 100644 --- a/SWIG/Lib/python/std_common.i +++ b/SWIG/Lib/python/std_common.i @@ -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, std::vector, etc) diff --git a/SWIG/Lib/python/std_container.i b/SWIG/Lib/python/std_container.i index b4b3f9bab..d1261c3ee 100644 --- a/SWIG/Lib/python/std_container.i +++ b/SWIG/Lib/python/std_container.i @@ -105,7 +105,15 @@ template 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