[Issue 12515] New: memchr/wmemchr/dmemchr in druntime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 3 14:02:03 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12515

           Summary: memchr/wmemchr/dmemchr in druntime
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2014-04-03 14:01:53 PDT ---
This is a request to have a trio of functions in druntime, that do what memchr
does, but also for 1-byte, 2-byte and 4-byte widths (and maybe 8 bytes too).

The issue with C's wmemchr is that works on `wchar_t`, which may be either a
wchar or dchar, making it horribly difficult to use in a generic way (or at
all).

Having these methods in druntime would be able to do memory wise search in a
much easier fashion.

It would also have the advantage of:
- accept a "const(void)[]" as input, so using them is "just safe".
- have a __ctfe branch, so no special branches need to be deployed by the
caller: It "just works".

Not sure which druntime (or phobos?) library it would go into. Also, a rename
might help, to avoid ambiguity "[cwdl]memsearch?"

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


More information about the Digitalmars-d-bugs mailing list