Logo

Programming-Idioms

History of Idiom 50 > diff from v67 to v68

Edit summary for version 68 by programming-idioms.org:
[C++] Warning: infinite loop without side-effects is undefined behaviour.

Version 67

2021-04-02, 17:35:44

Version 68

2021-05-25, 11:43:50

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.

Ouroboros eating its own tail
Code
for (;;) {
	/// Do something
}
Code
for (;;) {
	/// 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.

Warning: infinite loop without side-effects is undefined behaviour.