[Lldb-commits] [lldb] [lldb] In-progress — All ValueObjectSP instances are now valid (non-null) but have an error state (PR #74912)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 19 15:58:14 PST 2023
clayborg wrote:
> > ### Goal
> > Every `ValueObjectSP` will have an actual value and will never be equal to `nullptr`.
>
> I would like to learn more about the goal. It seems like the existing code will result in widespread use of `optional<shared_ptr<ValueObject>>`. Is the plan to reduce these cases to a smaller amount? If not, then it's not clear to me how having the codebase predominantly use `optional<shared_ptr<ValueObject>>` is better than mostly using `shared_ptr<ValueObject>`. Is this refactoring a known (named) pattern? Are there other examples of where a `shared_ptr<T>` is replaced with `optional<shared_ptr<T>>`?
I agree. Returning a empty shared pointer is better than adding std:optional on top of that. Hopefully we can avoid that.
https://github.com/llvm/llvm-project/pull/74912
More information about the lldb-commits
mailing list