mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1346345 - Implement != operator for IPDL structs. r=kanru
MozReview-Commit-ID: H1CDbuXZ5U0 --HG-- extra : rebase_source : 88005a00cf7c9625179b63354d8947635fcf8d2a
This commit is contained in:
parent
2d0b942fdc
commit
91a4a0b1a5
@ -1833,6 +1833,16 @@ def _generateCxxStruct(sd):
|
||||
opeqeq.addstmt(StmtReturn.TRUE)
|
||||
struct.addstmts([ opeqeq, Whitespace.NL ])
|
||||
|
||||
# bool operator!=(const Struct& _o)
|
||||
opneq = MethodDefn(MethodDecl(
|
||||
'operator!=',
|
||||
params=[ Decl(constreftype, ovar.name) ],
|
||||
ret=Type.BOOL,
|
||||
const=1))
|
||||
opneq.addstmt(StmtReturn(ExprNot(ExprCall(ExprVar('operator=='),
|
||||
args=[ ovar ]))))
|
||||
struct.addstmts([ opneq, Whitespace.NL ])
|
||||
|
||||
# field1& f1()
|
||||
# const field1& f1() const
|
||||
for f in sd.fields:
|
||||
|
Loading…
Reference in New Issue
Block a user