The OpenD Programming Language

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

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.

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.

Meta