www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18929] New: std.range.chain with single elements too

https://issues.dlang.org/show_bug.cgi?id=18929

          Issue ID: 18929
           Summary: std.range.chain with single elements too
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: jack jackstouffer.com

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'));
============

--
May 31 2018