Displaying 2 results from an estimated 2 matches for "set_thing".
Did you mean:
set_string
2014 Jul 17
3
[LLVMdev] Use of Smart Pointers in LLVM Projects
...ing pointer in that regard)
> so there's no benefit in enforcing smart pointer usage at creation.
I believe there is. Like const member functions it helps ensure that
ownership is transferred clearly. It's not hard to write bugs like:
T *t = create();
...
if (error)
return; // leak
set_thing(t); // transfer ownership here
By making create return a std::unique_ptr, it discourages these kinds
of misuses.
> Apart from the complexity and visual clutter, it's pretty annoying to have
> to decide whether to get(), release() or somehow else acquire the object you
> just created....
2014 Jul 17
8
[LLVMdev] Use of Smart Pointers in LLVM Projects
There seems to be some uncertainty about the use of smart pointers
(previously OwningPtr, now std::unique_ptr and std::shared_ptr
predominantly) in the LLVM project as a whole, so here's a thread to
discuss/clarify/etc the project preferences/direction with regard to
smart pointer usage.
For some context, see discussions in LLVM r212403 and Clang r213307.
The basic question here seems to be