Closed Bug 178180 Opened 22 years ago Closed 22 years ago

|nsCOMPtr|: is it time to remove the |address_of| hack?

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 132278

People

(Reporter: scc, Assigned: scc)

References

Details

|nsCOMPtr| has extra machinery, the intent of which was to discourage clients from applying old-style casts to |nsCOMPtr|s, and/or pass them by address. Maybe this machinery has outlived its usefulness, and it's time to simplify. If we remove this machinery, will transgressions be caught in review? Did this machinery ever really discourage the kind of misuse it targeted?
It certainly made users of address_of very obvious and people have been slowly eliminating them as a result....
Status: NEW → ASSIGNED
Severity: normal → enhancement
I thought we already removed the private operator&.
I found several instances in the plugin code that use operator & on an nsCOMPtr. So I think the answers to "Will the transgressions be caught in review" is no. http://lxr.mozilla.org/seamonkey/source/embedding/browser/activex/src/plugin/XPConnect.cpp#761 And yes, if there was a private operator &, it was removed.
FYI, filed bug 189296 for the plugin code
Marking this a dupe of bug 132278 I came across the original bug that dealt with this. And read the explanation for removing it, so sounds like a good idea. Also the plugin code looks to be the only code that abuses taking an address of an nsCOMPtr. *** This bug has been marked as a duplicate of 132278 ***
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.