Cleverness of the compiler

Namespace rswhite4 at googlemail.com
Sun Nov 24 16:54:42 PST 2013


I meant the function:
----
void at(T)(ref Tarray arr, size_t index, T* elem) {
  	if (index >= arr.length || elem is null)
  		return;

  	memcpy(elem, &arr.ptr[index], T.sizeof);
}
----
-> arr.ptr[index]


More information about the Digitalmars-d-learn mailing list