News for hackers. Stuff that matters.
Re:Writing a custom iterator in modern C++ by stkdump on Monday December 21, 2020 @07:12AM (#25494166)
Why would you need a union?
Re:Writing a custom iterator in modern C++ by mehrdadn on Monday December 21, 2020 @07:15AM (#25494195)
Write me some code that shows me how to compose iterator-based ranges with just 1 iterator's worth of space in each range.
Re:Writing a custom iterator in modern C++ by stkdump on Monday December 21, 2020 @03:48PM (#25499373)
It is not so clear to me what you mean. Maybe you can point to a better version (maybe what some other language does), and I can explain how I think the same can be done with C++20 ranges. I believe ranges are strictly more powerful than what other languages provide, and often they can be slimmer/more efficient for the common case.