var.visitNogc

auto visitNogc(handlers...)() const @safe @nogc

visitNogc is a no-GC variant of visit.

It performs the same type-based dispatch as visit, but is annotated @nogc.

Notes:

  • Any chosen handler must also be @nogc.
  • Unlike visit, the fallback handler accepting var receives the original

value (or var.init for NULL) without allocating.

Parameters

handlersOne or more callable handlers for different types.

Returns

The result of calling the matched handler, or R.init if no handler matches.