Function deref

Dereferences a thing

auto ref auto deref(T) (
  auto inout ref T t
)
if (from.std.traits.isPointer!T);

auto ref auto deref(T) (
  auto ref T t
)
if (from.std.range.isInputRange!T);

auto ref auto deref(T) (
  auto inout ref Nullable!T t
);

Could be a range, a pointer, or a nullable.

Since

- 0.0.1

Example

import std.typecons: nullable;
const a = nullable(1);
const b = new int(1);
auto c = [1];

assert(a.deref == 1);
assert(b.deref == 1);
assert(c.deref == 1);