MCPcopy Create free account
hub / github.com/WheretIB/nullc / operator[]

Function operator[]

tests/TestConversions.cpp:47–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45TEST_RESULT("Auto ref to value conversion", testAutoRefToValue, "14");
46
47const char *testImplicitConversionOnReturn =
48"class array{ int[10] arr; int size; }\r\n\
49void array:push_back(auto ref a){ arr[size++] = int(a); }\r\n\
50auto ref operator[](array ref arr, int index){ assert(index<arr.size); return &arr.arr[index]; }\r\n\
51\r\n\
52array a;\r\n\
53a.push_back(1); a.push_back(5);\r\n\

Callers

nothing calls this directly

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected