[Issue 18929] New: std.range.chain with single elements too
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Thu May 31 19:46:38 UTC 2018
    
    
  
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 at puremagic.com
          Reporter: jack at 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'));
============
--
    
    
More information about the Digitalmars-d-bugs
mailing list