Re:Current hardware trends make C++ exceptions harder to jus...
by im3w1l on Tuesday February 22, 2022 @02:47PM
(#30432696)
You could use an output pointer parameter. You could construct an object which self-reports as invalid. You could take an error handler callback. You could use a global variable.
Or I think my preference would be a private constructor, and a friend-function that returns value-or-error.
Or I think my preference would be a private constructor, and a friend-function that returns value-or-error.