Pre-RFC: minimal, flexible placement and returning unsized types

Hmm, I think I would say that (for the purposes of this proposal) returning anything that is neither of a) an ‘rvo literal’ and b) a require_rvo function would cause compilation failure of a require_rvo function.

Then you need to define ‘rvo literal’ which is something like:

which looks basically like writing down the examples you’ve given that will be RVO optimised.

On reflection, I think you already need to enforce the above conditions to decide whether a function is able to return a DST - require_rvo just allows you to opt in with statically sized types.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.