newShared

Create a new shared pointer of class type T, using allocator Allocator. T will be created by using constructor that accepts Args. The default allocator is Mallocator.

  1. auto newShared(Args args)
    @safe @nogc @trusted
    newShared
    (
    T
    Allocator = Mallocator
    Args...
    )
    (
    Args args
    )
    if (
    is(T == class)
    )
  2. auto newShared(Args args)

Examples

class A {}
const auto sptr = newShared!A();

Meta