http://d.puremagic.com/issues/show_bug.cgi?id=9421

           Summary: (Compiler internals) Change OutBuffer's interface
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from yebblies <[email protected]> 2013-01-29 19:31:03 EST ---
Using OutBuffer makes it easy to forget to zero-terminate strings and create
dangling pointers.  I'm think we should make OutBuffer a little less error
prone.

Changes:
- Get rid of toChars
- Add extractString which checks for a '\0' then takes ownership of the
internal buffer
- Add scopedString which checks for a '\0' then return a reference to the
internal buffer
- Add scopedData which returns a reference to the internal buffer

Benefit:
- Nobody will use toChars thinking that it copies/owns the data
- Harder to forget to zero-terminate strings
- Hopefully less casting

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to