Closed
Bug 523651
Opened 15 years ago
Closed 15 years ago
Add a CallQueryInterface that can work with nsCOMPtr
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file)
884 bytes,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
I'm tired of all the casting if I want to QI something with ambiguous nsISupports inheritance.
Assignee | ||
Comment 1•15 years ago
|
||
Attachment #407554 -
Flags: review?(benjamin)
Comment 2•15 years ago
|
||
Comment on attachment 407554 [details] [diff] [review] Fix The static_cast *looks* wrong... I thought static_cast wasn't supposed to run cast operators, which is obviously what's happening here. I'd be happier with a c-style cast here: (DestinationType**) aDestination
Attachment #407554 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 3•15 years ago
|
||
static_cast does do cast operators. Testcase: #include "stdio.h" class A { public: operator int() { return 5; } }; int main() { A a; printf("%d\n", static_cast<int>(a)); } prints 5 over here. I can switch to c-style, though.
I think static_cast is better; less risk of accidentally turning into a reinterpret_cast.
Assignee | ||
Comment 5•15 years ago
|
||
Pushed http://hg.mozilla.org/mozilla-central/rev/a75d7681fa2f
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•