charPtr

This overload allocates the required memory from an existing stack buffer.

  1. auto charPtr(void* buffer)
  2. immutable(char)* charPtr()
  3. StackBufferEntry!char charPtr(const(char)[] str, SB sb)
    @nogc nothrow
    charPtr
    (
    SB
    )
    (
    const(char)[] str
    ,
    ref SB sb
    )
    if (
    is(SB == StackBuffer!bytes,
    bytes...
    )
    )

Parameters

str const(char)[]

The source string to convert to a C UTF-8 string

sb SB

The stack buffer to allocate from

Note: Always assign the result to an auto variable first for RAII to work correctly.

Meta