Open felipecrv opened 1 year ago
@felipecrv should we close this issue? I see that it was resolved by this PR
@felipecrv should we close this issue? I see that it was resolved by this PR
Not really because there are many other functions and constructors that should go through to this. list
and ListViewType
were just examples.
The steps for working on this:
shared_ptr&
to shared_ptr
(usually constructors)std::move
at all callsites but make sure (by code review) that the value that is std::move
'd from is not used after the call
Describe the enhancement requested
Types like
ListType
and factory functions likelist
take aconst std::shared_ptr<DataType>&
instead of astd::shared_ptr<DataType>
that could be moved into the newly constructedListType
without the need of bumping a refcount and still support cases where caller can only give it a reference.Currently:
After this issue is fixed:
When working on this, we should take the time to go through every callsite and decide if a
std::move()
is possible without breaking correctness — things could break if the parameter is used after it's moved into the new instance of a parametric type.Component(s)
C++