MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / util_getElemFromNestedPtrs

Function util_getElemFromNestedPtrs

quest/src/core/utilities.cpp:302–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302qcomp util_getElemFromNestedPtrs(void* in, qindex* inds, int numInds) {
303 qindex ind = inds[0];
304
305 if (numInds == 1)
306 return ((qcomp*) in)[ind];
307
308 qcomp* ptr = ((qcomp**) in)[ind];
309 return util_getElemFromNestedPtrs(ptr, &inds[1], numInds-1); // compiler may optimise tail-recursion
310}
311
312
313

Calls

no outgoing calls

Tested by

no test coverage detected