Jim Blandy於 2016年4月28日星期四 UTC+8下午1時51分15秒寫道:
> I don't really think it's a good example. TakeMediaIfKnown is accepting a
> UniquePtr<MediaFile> as an inout parameter: it uses, and may modify, its
> value. It should take UniquePtr<MediaFile> &.
IIUC, UniquePtr<T> can't be an inout parameter for its unique semantics which 
owns sole ownership of an object. The caller won't be able to use the object in 
a meaningful way after the function returns.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to