fix [ 1432152 ] %rename friend operators in namespace
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8825 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
30e5b5b666
commit
5236d3ddf3
3 changed files with 29 additions and 0 deletions
|
|
@ -47,3 +47,22 @@ namespace oss
|
||||||
%template(Natural_BP) Natural<BinaryPolarization>;
|
%template(Natural_BP) Natural<BinaryPolarization>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%rename("equals") operator==;
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
|
||||||
|
namespace Utilities {
|
||||||
|
class Bucket
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Bucket() : m_left(0) {}
|
||||||
|
friend bool operator==(const Bucket& lhs, const Bucket& rhs){
|
||||||
|
return ( rhs.m_left == lhs.m_left );
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
int m_left;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
|
||||||
|
|
@ -310,6 +310,7 @@ static void add_symbols(Node *n) {
|
||||||
Delete(base);
|
Delete(base);
|
||||||
Delete(prefix);
|
Delete(prefix);
|
||||||
}
|
}
|
||||||
|
Namespaceprefix = 0;
|
||||||
} else {
|
} else {
|
||||||
/* for member functions, we need to remove the redundant
|
/* for member functions, we need to remove the redundant
|
||||||
class scope if provided, as in
|
class scope if provided, as in
|
||||||
|
|
|
||||||
|
|
@ -519,6 +519,15 @@ Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType *dec
|
||||||
if (!rn) {
|
if (!rn) {
|
||||||
rn = name_object_get(namehash, name, decl, ncdecl);
|
rn = name_object_get(namehash, name, decl, ncdecl);
|
||||||
}
|
}
|
||||||
|
if (!rn && Swig_scopename_check(name)) {
|
||||||
|
String *nprefix = NewStringEmpty();
|
||||||
|
String *nlast = NewStringEmpty();
|
||||||
|
Swig_scopename_split(name, &nprefix, &nlast);
|
||||||
|
rn = name_object_get(namehash, nlast, decl, ncdecl);
|
||||||
|
Delete(nlast);
|
||||||
|
Delete(nprefix);
|
||||||
|
}
|
||||||
|
|
||||||
Delete(tname);
|
Delete(tname);
|
||||||
|
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue