Switch FuncType capture-list storage to optional<vector<Capture>>

May help clarify overall mem-mgmt/ownership semantics.
This commit is contained in:
Jon Siwek 2021-01-11 15:57:58 -08:00
parent ab15a98b28
commit b08112b2e7
8 changed files with 44 additions and 41 deletions

View file

@ -419,7 +419,7 @@ broker::expected<broker::data> Frame::SerializeCopyFrame()
}
std::pair<bool, FramePtr> Frame::Unserialize(const broker::vector& data,
const std::vector<FuncType::Capture*>* captures)
const std::optional<FuncType::CaptureList>& captures)
{
if ( data.size() == 0 )
return std::make_pair(true, nullptr);
@ -505,7 +505,7 @@ std::pair<bool, FramePtr> Frame::Unserialize(const broker::vector& data,
std::advance(where, 1);
auto closure_pair = Frame::Unserialize(*has_vec, nullptr);
auto closure_pair = Frame::Unserialize(*has_vec, {});
if ( ! closure_pair.first )
{
for ( auto& i : outer_ids )