> Я тоже сначала засомневался насчет временного объекта, но > решил себя проверить и быстро воткнул код в проект, что был > под рукой. Сработало так, как будто объект был не > временным, я даже порадовался и решил запомнить на будущее. > Сейчас попробовал воспроизвести, не получилось ни там, ни > на чистом проекте. Может быть, это такие шутки minimal > rebuild.
If the result of the code is not used somewhere further, the Microsoft compiler will strip the code (you will not find that code in *.asm), for example, the code below will not result in an exception in the release (optimized) version:
void f()
{
A a;
int b = 0;
int c = 1/b;
}
But the same code will give you an exception, if you force the compiler to leave the code { int b = 0; int c = 1/b;}
For example,
void f()
{
A a;
int b = 0;
int c = 1/b;
printf("%d", c);
}
Will it help?
|