remove std::set from new extended functions, as

it was failing due to non-assignable iterator.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9774 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-05-05 11:19:54 +00:00
commit f92ebdbe07
5 changed files with 73 additions and 39 deletions

View file

@ -200,5 +200,42 @@ namespace std {
%}
//
// Fragment that contains traits to properly deal with GC_VALUE.
// These functions may be invoked as a need of the from(), asval(),
// asptr() and as() template functors, usually used in %typemaps.
//
%fragment(SWIG_Traits_frag(swig::GC_VALUE),"header",fragment="StdTraits") {
namespace swig {
template <> struct traits<GC_VALUE > {
typedef value_category category;
static const char* type_name() { return "GC_VALUE"; }
};
template <> struct traits_from<GC_VALUE> {
typedef GC_VALUE value_type;
static VALUE from(const value_type& val) {
return static_cast<VALUE>(val);
}
};
template <>
struct traits_check<GC_VALUE, value_category> {
static bool check(GC_VALUE) {
return true;
}
};
template <> struct traits_asval<GC_VALUE > {
typedef GC_VALUE value_type;
static int asval(VALUE obj, value_type *val) {
if (val) *val = obj;
return SWIG_OK;
}
};
} // swig
} // %fragment(traits for swig::GC_VALUE)
#endif // __cplusplus
#endif