[Issue 21034] New: concatenation with a string literal could also append the trailing null
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sat Jul 11 01:23:05 UTC 2020
    
    
  
https://issues.dlang.org/show_bug.cgi?id=21034
          Issue ID: 21034
           Summary: concatenation with a string literal could also append
                    the trailing null
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com
This currently fails:
---
void main()
{
    string s = "0123";
    auto c = &s[2];
    s =  "0";
    s = s ~ "1";
    assert(*c == '\0');
}
---
this would be a enhacement to support this. Example: add an extension and pass
the .ptr property directly to a C style API, without having to call toUTFz /
toStringz
--
    
    
More information about the Digitalmars-d-bugs
mailing list