4 ms·
Technically C/C++ have an as-if rule (the optimizer can do whatever it wants as long as the program behaves as-if it ran the source code provided) that allows t
by im3w1l 4y ago
Technically C/C++ have an as-if rule (the optimizer can do whatever it wants as long as the program behaves as-if it ran the source code provided) that allows the optimizer to create cached copies and/or omit the memset. There is no way to express in C/C++ that all traces of a given variable should be removed. Though I guess there are constructs that work well enough in practice and you can always check the generated assembly.