The following is a simplified version of a pattern I sometimes see in my students' code:
bool foobar(int a, int b)
{
if (a < b) return true;
}
The real code is more complicated, of course. Visual Studio reports a warning C4715 (not all control paths return a value), and I would like to treat all warnings C4715 as errors. Is that possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…