Yeah, I was just coming to the same conclusion;
(I love it when this forum is faster at typing than my brain is at thinking )
Also seems that we already have the iterator adapter in
itertools::tuple_windows(), which clones all the values.
tuple_windows clones the iterator elements so that they can be part of successive windows, this makes it most suited for iterators of references and other values that are cheap to copy.
( All the excellent forumites here make it so hard to be helpful; by the time I’ve worked through a problem I’m trying to be helpful on, I’m usually already ninja’d twice by other even-more-helpful people, who provide even-better-solutions. Frustrating! )