[LLVMdev] [cfe-dev] New type of smart pointer for LLVM
Argyrios Kyrtzidis
akyrtzi at gmail.com
Thu Nov 13 14:20:10 PST 2014
> On Nov 13, 2014, at 11:25 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
> I'd generally prefer conditional ownership over shared ownership if possible - it's a narrower contract & I can still think about where the single owner is.
I’m not so sure. With unique_ptr and shared_ptr you know exactly what is the ownership, without needing to know where it came from, it is very clear.
With conditional ownership I will have to hunt around in the codebase and find the trail between different code paths for where the pointer came from, so that I know who owns it and in what conditions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141113/6113c910/attachment.html>
More information about the llvm-dev
mailing list