cppfront
cppfront copied to clipboard
New returns optional of owning reference
trafficstars
This patch represents a suggestion: Default new should return std::optional<owning_reference<T>> with owning_reference managing the life time of the object in a similar way as a unique_ptr would with the exception that it is not allowed to be null.
This will allow to move the reference around without null checks.