Lazy evaluation in C++