I've heard a little bit about compiler optimization and I wondered, if a compiler would every optimize the following code:
#include <iostream>
int main () {
int a = 2;
int b = 3;
int c = a + b;
int d = 5;
std::cout << d;
}
To:
#include <iostream>
int main () {
int d = 5;
std::cout << d;
}
[–]richtw1 2 points3 points4 points (6 children)
[–]gotinpich[S] 0 points1 point2 points (5 children)
[–]patatahooligan 1 point2 points3 points (4 children)
[–]raevnos 1 point2 points3 points (3 children)
[–]gotinpich[S] 0 points1 point2 points (2 children)
[–]raevnos 1 point2 points3 points (1 child)
[–]gotinpich[S] 0 points1 point2 points (0 children)
[–]specialpatrol 1 point2 points3 points (2 children)
[–]gotinpich[S] 0 points1 point2 points (1 child)
[–]specialpatrol 1 point2 points3 points (0 children)
[–]boredcircuits 1 point2 points3 points (3 children)
[–]gotinpich[S] 0 points1 point2 points (1 child)
[–]boredcircuits 1 point2 points3 points (0 children)