Comment by charcircuit
Comment by charcircuit 17 hours ago
This is like trying to defend that you can't statically know the result of 1 + 2 because:
void foo() {
std::random_device rdev {};
auto dist = std::uniform_int_distribution<>(0, 1);
if (dist(rdev)) {
int res = 1 + 2;
}
}
I can tell you for sure that the result of 1 + 2 will be 3.
> This is like trying to defend that you can't statically know the result of 1 + 2
It is completely unlike that. tsimionescu is asserting that they can always know statically whether `foo` will move its parameter. The function I provided is a counter-example to that assertion.
Of course the branch body always moves, that's what it's there for. That has no bearing on the argument.