Suppose I have the following code:
std::vector<T> R; if (condition) R = generate(); ... for (int i = 0; i < N; ++i) { const auto &r = (R.empty() ? generate() : R); }
It seems that generate is called independently of R.empty() . Is this standard behavior?
source share