summaryrefslogtreecommitdiff
path: root/Lib/python/std_map.i
diff options
context:
space:
mode:
authorStefan Zager <szager@gmail.com>2011-07-15 18:49:32 +0000
committerStefan Zager <szager@gmail.com>2011-07-15 18:49:32 +0000
commite167400a2909c68eb08e86896f8834f39ee9f09b (patch)
treea7336916b0528ad8ce6e172633aff66a2375f771 /Lib/python/std_map.i
parent62a88f3613af41d97c40dc928678c0d90ecba64f (diff)
downloadswig-e167400a2909c68eb08e86896f8834f39ee9f09b.tar.gz
Fixed issue from swig-user 6/27/11.
Support code in std_map.i needs all the template parameters that std::map takes, even the default ones (Compare, Allocator). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12759 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/python/std_map.i')
-rw-r--r--Lib/python/std_map.i20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/python/std_map.i b/Lib/python/std_map.i
index fec816222..37d749790 100644
--- a/Lib/python/std_map.i
+++ b/Lib/python/std_map.i
@@ -5,19 +5,19 @@
%fragment("StdMapTraits","header",fragment="StdSequenceTraits")
{
namespace swig {
- template <class SwigPySeq, class K, class T >
+ template <class SwigPySeq, class K, class T, class Compare, class Alloc >
inline void
- assign(const SwigPySeq& swigpyseq, std::map<K,T > *map) {
- typedef typename std::map<K,T>::value_type value_type;
+ assign(const SwigPySeq& swigpyseq, std::map<K,T,Compare,Alloc > *map) {
+ typedef typename std::map<K,T,Compare,Alloc >::value_type value_type;
typename SwigPySeq::const_iterator it = swigpyseq.begin();
for (;it != swigpyseq.end(); ++it) {
map->insert(value_type(it->first, it->second));
}
}
- template <class K, class T>
- struct traits_asptr<std::map<K,T> > {
- typedef std::map<K,T> map_type;
+ template <class K, class T, class Compare, class Alloc>
+ struct traits_asptr<std::map<K,T,Compare,Alloc > > {
+ typedef std::map<K,T,Compare,Alloc > map_type;
static int asptr(PyObject *obj, map_type **val) {
int res = SWIG_ERROR;
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
@@ -27,7 +27,7 @@
/* In Python 3.x the ".items()" method returns a dict_items object */
items = PySequence_Fast(items, ".items() didn't return a sequence!");
%#endif
- res = traits_asptr_stdseq<std::map<K,T>, std::pair<K, T> >::asptr(items, val);
+ res = traits_asptr_stdseq<map_type, std::pair<K, T> >::asptr(items, val);
} else {
map_type *p;
res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<map_type>(),0);
@@ -38,9 +38,9 @@
}
};
- template <class K, class T >
- struct traits_from<std::map<K,T> > {
- typedef std::map<K,T> map_type;
+ template <class K, class T, class Compare, class Alloc >
+ struct traits_from<std::map<K,T,Compare,Alloc > > {
+ typedef std::map<K,T,Compare,Alloc > map_type;
typedef typename map_type::const_iterator const_iterator;
typedef typename map_type::size_type size_type;