safeRefCounted

fnSafeRefCounted!(T, RefCountedAutoInitialize.no) safeRefCounted(T)(T val)

Initializes a SafeRefCounted with val. The template parameter T of SafeRefCounted is inferred from val. This function can be used to move non-copyable values to the heap. It also disables the autoInit option of SafeRefCounted.

Parameters

valThe value to be reference counted

Returns

An initialized SafeRefCounted containing val.

See Also