You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the generated code for UnPack, a unique_ptr is used internally - which was done in #5761 to prevent a leak in an OOM condition.
However, the signature of the function still returns a bare pointer. Perhaps this was left as-is for compatibility reasons, but this code would be much better if it returned the unique_ptr instead.
If the compatibility break would be too onerous for C++ users, then this behaviour could be behind a commandline option. I personally doubt this in any case since modern C++ code should immediately wrap this return value in a smart pointer, which would still compile with the change.
The text was updated successfully, but these errors were encountered:
In the generated code for UnPack, a unique_ptr is used internally - which was done in #5761 to prevent a leak in an OOM condition.
However, the signature of the function still returns a bare pointer. Perhaps this was left as-is for compatibility reasons, but this code would be much better if it returned the unique_ptr instead.
If the compatibility break would be too onerous for C++ users, then this behaviour could be behind a commandline option. I personally doubt this in any case since modern C++ code should immediately wrap this return value in a smart pointer, which would still compile with the change.
The text was updated successfully, but these errors were encountered: