Include all template parameters for std_unordered_multiset and std_unordered_set
This commit is contained in:
parent
4a25ddbb97
commit
f3e2ab9195
4 changed files with 46 additions and 46 deletions
|
|
@ -5,9 +5,9 @@
|
|||
%fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits")
|
||||
%{
|
||||
namespace swig {
|
||||
template <class SwigPySeq, class Key>
|
||||
template <class SwigPySeq, class Key, class Hash, class Compare, class Alloc>
|
||||
inline void
|
||||
assign(const SwigPySeq& swigpyseq, std::unordered_set<Key>* seq) {
|
||||
assign(const SwigPySeq& swigpyseq, std::unordered_set<Key,Hash,Compare,Alloc>* seq) {
|
||||
// seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
|
||||
typedef typename SwigPySeq::value_type value_type;
|
||||
typename SwigPySeq::const_iterator it = swigpyseq.begin();
|
||||
|
|
@ -16,24 +16,24 @@
|
|||
}
|
||||
}
|
||||
|
||||
template <class Key>
|
||||
struct traits_reserve<std::unordered_set<Key> > {
|
||||
static void reserve(std::unordered_set<Key> &seq, typename std::unordered_set<Key>::size_type n) {
|
||||
template <class Key, class Hash, class Compare, class Alloc>
|
||||
struct traits_reserve<std::unordered_set<Key,Hash,Compare,Alloc> > {
|
||||
static void reserve(std::unordered_set<Key,Hash,Compare,Alloc> &seq, typename std::unordered_set<Key,Hash,Compare,Alloc>::size_type n) {
|
||||
seq.reserve(n);
|
||||
}
|
||||
};
|
||||
|
||||
template <class Key>
|
||||
struct traits_asptr<std::unordered_set<Key> > {
|
||||
static int asptr(PyObject *obj, std::unordered_set<Key> **s) {
|
||||
return traits_asptr_stdseq<std::unordered_set<Key> >::asptr(obj, s);
|
||||
template <class Key, class Hash, class Compare, class Alloc>
|
||||
struct traits_asptr<std::unordered_set<Key,Hash,Compare,Alloc> > {
|
||||
static int asptr(PyObject *obj, std::unordered_set<Key,Hash,Compare,Alloc> **s) {
|
||||
return traits_asptr_stdseq<std::unordered_set<Key,Hash,Compare,Alloc> >::asptr(obj, s);
|
||||
}
|
||||
};
|
||||
|
||||
template <class Key>
|
||||
struct traits_from<std::unordered_set<Key> > {
|
||||
static PyObject *from(const std::unordered_set<Key>& vec) {
|
||||
return traits_from_stdseq<std::unordered_set<Key> >::from(vec);
|
||||
template <class Key, class Hash, class Compare, class Alloc>
|
||||
struct traits_from<std::unordered_set<Key,Hash,Compare,Alloc> > {
|
||||
static PyObject *from(const std::unordered_set<Key,Hash,Compare,Alloc>& vec) {
|
||||
return traits_from_stdseq<std::unordered_set<Key,Hash,Compare,Alloc> >::from(vec);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue