Range Redesign: Copy Semantics
Quirin Schroll
qs.il.paperinik at gmail.com
Thu Feb 1 17:06:46 UTC 2024
On Wednesday, 24 January 2024 at 20:08:56 UTC, Jonathan M Davis
wrote:
> Traits like that can test (and thus be used to enforce) _some_
> of the semantics, but there are plenty of things that can't be
> tested statically (like what popFront actually does).
Even if you could, what would you even test? Especially for
`popFront`, what does it mean to “pop front”? A no-op could be a
reasonable `popFront` implementation for a range that represents
a value infinitely repeated, i.e. something like `cycle(1)`.
More information about the Digitalmars-d
mailing list