On Thursday, 3 September 2015 at 13:28:54 UTC, Sergei Degtiarev
wrote:
Agree, however, memory obtained with mmap(..., PROT_READ, ..);
is essentially read-only and any attempt to write to it will
cause immediate crash with segmentation violation. It would be
very desirable in this case to return something that could be
cast to immutable(type)[] but not type[].
This is what I tried to find out. Thank you for the help.
immutable(T)[] getGetData(T)() {
return cast(immutable(T)[])data;
}
...
auto ints = obj.getData!int;