Bug 24081 – [Function countUntil] countUntil is a terrible name

Status
NEW
Severity
enhancement
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-08-11T19:55:04Z
Last change time
2024-12-01T16:41:39Z
Assigned to
No Owner
Creator
crazymonkyyy
Moved to GitHub: phobos#9862 →

Comments

Comment #0 by crazymonkyyy — 2023-08-11T19:55:04Z
its been like a dozen times I stared at the list of functions wanting this function just to be called indexOf
Comment #1 by b2.temp — 2023-08-11T20:04:43Z
I dont fully agree, here is why: ``` template indexOf(T) if (isRandomAccessRange!T) { alias indexOf = countUntil; } ``` as you can see `indexOf` denotes _indexing_ capabilitites, but countUntil works for all forward range.
Comment #2 by robert.schadek — 2024-12-01T16:41:39Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9862 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB