fix Solaris/assign problem
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6184 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
977a99a2c7
commit
24a7abba20
2 changed files with 17 additions and 0 deletions
|
|
@ -8,6 +8,15 @@
|
||||||
//
|
//
|
||||||
//#define SWIG_STD_NOMODERN_STL
|
//#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
|
// Define or uncomment the following macro to instantiate by default
|
||||||
// all the basic std typemaps (std::pair<T,U>, std::vector<T>, etc)
|
// all the basic std typemaps (std::pair<T,U>, std::vector<T>, etc)
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,15 @@
|
||||||
template <class PySeq, class Seq>
|
template <class PySeq, class Seq>
|
||||||
inline void
|
inline void
|
||||||
assign(const PySeq& pyseq, Seq* seq) {
|
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());
|
seq->assign(pyseq.begin(), pyseq.end());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Seq, class T = typename Seq::value_type >
|
template <class Seq, class T = typename Seq::value_type >
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue