RefCounted

A reference-counted smart pointer similar to C++'s std::shared_ptr.

Constructors

this
this(Args args)

The allocator is a singleton, so no need to pass it in to the constructor

this
this(Allocator allocator, Args args)

Non-singleton allocator, must be passed in

Destructor

~this
~this()

Postblit

this(this)
this(this)

Alias This

_impl

Members

Aliases

Type
alias Type = RefCountedType
Undocumented in source.

Functions

opAssign
void opAssign(RefCounted other)

Assign to an lvalue RefCounted

opAssign
void opAssign(RefCounted other)

Assign to an rvalue RefCounted

opIndex
auto ref opIndex(A args)
opIndexAssign
auto ref opIndexAssign(A args)

Prevent opSlice and opIndex from being hidden by Impl*. This comment is deliberately not DDOC.

opSlice
auto ref opSlice(A args)

Prevent opSlice and opIndex from being hidden by Impl*. This comment is deliberately not DDOC.

opUnary
auto ref opUnary()

Dereference the smart pointer and yield a reference to the contained type.

Manifest constants

isGlobal
enum isGlobal;
Undocumented in source.
isSingleton
enum isSingleton;
Undocumented in source.
isTheAllocator
enum isTheAllocator;
Undocumented in source.

Static functions

construct
typeof(this) construct(Args args)

Factory method to enable construction of structs despite structs not being able to have a constructor with no arguments.

construct
typeof(this) construct(Allocator allocator, Args args)

Factory method. Not necessary with non-global allocator but included for symmetry.

Variables

_impl
ImplType* _impl;
Undocumented in source.

Meta