www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12515] New: memchr/wmemchr/dmemchr in druntime

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: monarchdodra gmail.com



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: -------
Apr 03 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12515


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



23:20:26 CEST ---
Speaking of which, will this be reopened?
https://github.com/D-Programming-Language/phobos/pull/1665

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