|
|
|
|
|
by jessermeyer
1462 days ago
|
|
As someone who avoids C++ these days ... Is this a compile time FizzBuzz? `(char*)&1[""]` is the empty string here returning its data segment address as the offset? Not sure about the purpose of `1`. Is the iteration achieved by the constructor basically re-invoking itself? |
|
Unless, of course, you have a very clever compiler that determines memory allocation is not actually allocating anything and that the output is a static string, and there are no side effects. Such a clever compiler could optimize it all into just one "puts" call.