MCPcopy Create free account
hub / github.com/WheretIB/nullc / __operatorIndex

Function __operatorIndex

NULLC/translation/std_vector_bind.cpp:144–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142 return ret;
143}
144NULLCRef __operatorIndex(vector * vec, int index, void* unused)
145{
146 NULLCRef ret = { 0, 0 };
147 if(index >= vec->currSize)
148 {
149 nullcThrowError("operator[] array index out of bounds");
150 return ret;
151 }
152 ret.typeID = (vec->flags ? typeid__subType_typeid_ref__(&vec->elemType) : vec->elemType);
153 ret.ptr = vec->flags ? ((char**)vec->data.ptr)[index] : (vec->data.ptr + vec->elemSize * index);
154 return ret;
155}
156void vector__reserve_void_ref_int_(int size, vector * vec)
157{
158 // If not enough space

Callers

nothing calls this directly

Calls 2

nullcThrowErrorFunction · 0.70

Tested by

no test coverage detected