On Monday, 22 April 2024 at 11:36:43 UTC, ChloƩ wrote:
The first implementation has the advantage is being simpler and empty being const, but has the downside that next is called even if the range ends up not being used. Is either approach used consistently across the D ecosystem?

You can also place initialization logic inside front, then empty could become const.

I don't think there is a preffered way of initializing such ranges, so imho consider what's best for your use case.

Reply via email to