std::expected and reference return type

Viewed 346

I am trying to use the proposed std::expected or some variation of the technique to replace my exception-using code, but I can't figure out how to use it in functions that return references in the current implementation. Any help would be appreciated.

P.S. Please don't tell me I should be using exceptions. I can't in this case, and the why of it is irrelevant to this question.

0 Answers
Related