On 04/18/2018 11:41 AM, Nick Treleaven wrote:
How do you implement this if the function returns with ref:

bool inserted;
auto p = aa.slot("key", &inserted);
if (inserted) {
   ...
   // set *p
}
else {
   // read *p
   ...
   // set *p
}

You can get a pointer from the ref return:

    Value* p = &aa.slot("key", { inserted = true; return Value.init; });

Then do with the pointer whatever you want.

Reply via email to