Bug 18929 – std.range.chain with single elements too

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-05-31T19:46:38Z
Last change time
2024-12-01T16:33:53Z
Keywords
bootcamp
Assigned to
No Owner
Creator
Jack Stouffer
Moved to GitHub: phobos#10339 →

Comments

Comment #0 by jack — 2018-05-31T19:46:38Z
In my opinion, this should compile as a matter of convenience. ============ import std.range; import std.utf; void main() { auto r = chain("test".byCodeUnit, 'a'); } ============ Under the hood, this can be easily translated to ============ auto r = chain("test".byCodeUnit, only('a')); ============
Comment #1 by greensunny12 — 2018-08-15T23:32:31Z
FWIW the built-in concatenation operator also allows this already: --- ([1, 2, 3] ~ 42 ~ [42, 43]).writeln; // [1, 2, 3, 42, 42, 43] --- https://run.dlang.io/is/md3qKz
Comment #2 by tiberiulepadatu14 — 2018-10-20T15:39:43Z
Can I work on this?
Comment #3 by robert.schadek — 2024-12-01T16:33:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10339 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB