Closed Bug 463337 Opened 17 years ago Closed 2 years ago

Implement nsAutoPtr/nsRefPtr in terms of classes from nsAutoRef.h

Categories

(Core :: XPCOM, defect)

x86
All
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: karlt, Unassigned)

Details

Now that we have nsAutoRef<T> and nsCountedRef<T> it may be an option to implement nsAutoPtr<T> and nsRefPtr<T> in terms of the former classes or at least nsAutoRefBase<T>, which may reduce the amount of code in nsAutoPtr.h a little. The fundamental difference between the classes in nsAutoRef.h and nsAutoPtr.h is that clients of nsAutoRef.h must provide specializations for the particular resource, while the clients of nsAutoPtr.h do not because nsAutoPtr<T> is always deleted with |delete| and nsRefPtr is always managed with T::AddRef() and T::Release(). Perhaps nsAutoPtr.h could use nsAutoRef.h and provide the necessary specializations of nsAutoRefTraits< Y<T> >, where Y are classes internal to nsAutoPtr.h, but I'm not certain about compiler support for partial specialization. (This bug is filed based on bug 461087 comment 5 and subsequent comments.)
Severity: normal → S3

I'm pretty sure we don't want to do this. Any effort on these classes should probably be spent on removing them (like bug 1055035).

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.