3 ms·
You probably mean N3664 [1]. The compiler is indeed allowed to get rid of allocations in new expressions it deems unnecessary. You can verify that recent versi
by pbsd 12y ago
You probably mean N3664 [1]. The compiler is indeed allowed to get rid of allocations in new expressions it deems unnecessary.
You can verify that recent versions of clang allocate no memory in the function
int f() { return *new int(123); }
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3664.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n366...