I think it makes sense to hide a 'new' call in a Make* function when you're writing an abstraction that handles allocation *and* deallocation.
So MakeUnique makes sense, because UniquePtr takes ownership of the allocated object, and will deallocate it in the destructor. MakeRefPtr would make sense for the same reason. But in cases where a library facility is not taking ownership of the object, and thus the user will need to write an explicit 'delete', it makes sense to require that the user also write an explicit 'new', for symmetry. NotNull is a bit of a weird case because it can wrap either a raw pointer or a smart pointer, so it doesn't clearly fit into either category. Perhaps it would make sense for MakeNotNull to only be usable with smart pointers? Cheers, Botond _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform