Casting ulong to int with @nogc

Selim Ozel sozel at
Wed Jul 28 17:41:04 UTC 2021

import std.conv:to;

import std.conv:to;

@nogc int
myFunction(ulong number){
return to!int(number);

Since is a non at nogc myFunction throws a compiler 
error. From a practical perspective length property of arrays 
return ulong. What do you think is a reasonable way of casting 
that into int with no-gc.


More information about the Digitalmars-d mailing list