This incredibly powerful facility is also available in C++20 with coroutines. 'yield return' is written as 'co_yield'. Also since "iterator" means something else in C++, this special usage of coroutines is called a "generator".
'co_yield' makes iterators/generators super easy to write as shown in this article. But also it enables great abstraction/encapsulation for where you want to provide an interface allowing callers to iterate over elements, without exposing the underlying container type.
(Note that 'std::generator' is not yet officially standardized, but with a little work we're using Microsoft's 'std::experimental::generator' across platforms, compiling with clang and gcc. Alternatively, I hear the cppcoro library is pretty great.)