Logo

Programming-Idioms

History of Idiom 50 > diff from v32 to v33

Edit summary for version 33 by :
[Cpp] Clarification for compiler warning

Version 32

2016-02-16, 18:03:43

Version 33

2016-02-16, 18:04:29

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Code
while (true) {
	// Do something
}
Code
while (true) {
	// Do something
}
Comments bubble
You may remove the curly braces if the block is only 1 instruction.
Comments bubble
You may remove the curly braces if the block is only 1 instruction.

The compiler might warn you that the loop expression is never false.