folly::memrchr

memrchr overloads

Synopses

Declared in <folly/lang/CString.h>

Find the last occurrence of a byte in a buffer (mimics glibc memrchr).

void*
memrchr(
    void* s,
    int c,
    std::size_t len) noexcept;
» more...

Find the last occurrence of a byte in a read-only buffer (mimics glibc memrchr).

void const*
memrchr(
    void const* s,
    int c,
    std::size_t len) noexcept;
» more...

Return Value

Pointer to the last matching byte, or nullptr if none

Parameters

NameDescription
sPointer to the buffer to search
cByte value to search for
lenNumber of bytes in the buffer