c++ - How to signify to the compiler that a function always throws? -
Always returns a function to a function when calling the function, then the compiler often warns that all the control paths have a value Do not return. Legally so
zero always (tropho) {"something"; } Bool fu () {if (cond) always money (); And come back to the truth; // Alert C4715 here}
Is there any way that always does it?
I know that I throw another after the function call
:
{always trance (); Throw "dummy"; }
And I know that I can explicitly disable the warning. But I was wondering if there is a more elegant solution.
With Visual C ++, you can use __declspec (Noreturn).
Comments
Post a Comment