deref

Dereferences a thing

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

  1. auto ref deref(auto ref T t)
  2. auto ref deref(auto ref T t)
  3. auto ref deref(auto ref Nullable!T t)
    ref
    deref
    (
    T
    )
    (
    auto ref Nullable!T t
    )

Examples

1 import std.typecons: nullable;
2 auto a = nullable(1);
3 auto b = new int(1);
4 auto c = [1];
5 
6 assert(a.deref == 1);
7 assert(b.deref == 1);
8 assert(c.deref == 1);

Meta

Since

- 0.0.1