Open Bug 1771052 Opened 3 years ago Updated 3 years ago

`nsCOMPtr` does not have a constructor which takes `StaticRefPtr<T>&`

Categories

(Core :: XPCOM, task)

task

Tracking

()

People

(Reporter: masayuki, Unassigned)

Details

RefPtr has a constructor which takes StaticRefPtr<T>&. Therefore, this style is available:

StaticRefPtr<Foo> sFoo;

void Bar::DoSomething() {
  RefPtr<Foo> foo = sFoo;
}

However, nsCOMPtr does not have the corresponding constructor. Therefore,

nsCOMPtr<Foo> foo = sFoo;

causes bustage, and you need to rewrite it with sFoo.get().

Type: defect → task
You need to log in before you can comment on or make changes to this bug.