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?"
Comment #1 by andrej.mitrovich — 2014-04-03T14:20:26Z