RCString.this

Constructs a qualified rcstring out of a number of bytes that will use the provided allocator object. For immutable objects, a RCISharedAllocator must be supplied. If no allocator is passed, the default allocator will be used.

  1. this(A allocator)
  2. this(ubyte[] bytes)
  3. this(A allocator, ubyte[] bytes)
    struct RCString
    this
    (
    A
    this Q
    )
    (,
    ubyte[] bytes...
    )
    if (
    !is(Q == shared) &&
    (
    is(A == RCISharedAllocator) ||
    !is(Q == immutable)
    )
    &&
    (
    is(A == RCIAllocator) ||
    is(A == RCISharedAllocator)
    )
    )
  4. this(string s)
  5. this(dstring s)
  6. this(wstring s)
  7. this(A allocator, R r)
  8. this(R r)

Parameters

allocator A
bytes ubyte[]

a variable number of bytes, either in the form of a list or as a built-in RCString

Complexity: O(m), where m is the number of bytes.

Examples

import std.experimental.allocator : theAllocator, processAllocator;

// Create a list from a list of ints
auto a = RCString(theAllocator, '1', '2', '3');

// Create a list from an array of ints
auto b = RCString(theAllocator, ['1', '2', '3']);
// Create a list from a list of bytes
auto a = RCString('1', '2', '3');

// Create a list from an array of bytes
auto b = RCString(['1', '2', '3']);

// Create a const list from a list of bytes
auto c = const RCString('1', '2', '3');

Meta