> It seems really dangerous that there is an implicit conversion from a strong
> ref ptr to a weak pointer. With C++11, you can thankfully require this
> conversion to be explicit which should alleviate your concern.

Wouldn't disallowing this implicit conversion break code which does

  void UseFoo(nsIFoo* foo);

  nsCOMPtr<nsIFoo> foo;
  UseFoo(foo);

?  That is an extremely common idiom in our code.

Like I say, maybe there's a way to allow lvalue nsRefPtr<T> to convert
to T*, but disallow the conversion for rvalue nsRefPtr<T>.  That would
be reasonable, I think.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to