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

Function map3

tests/TestGeneric.cpp:165–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163"import std.random;\r\n\
164void map1(auto[] arr, void ref(auto ref) f){for(int i = 0; i < arr.size; i++) f(arr[i]);}\r\n\
165void map2(generic arr, generic f){for(int i = 0; i < arr.size; i++) arr[i] = f(arr[i]);}\r\n\
166void map3(generic arr, generic f){for(int i = 0; i < arr.size; i++) f(arr[i]);}\r\n\
167int[] arr = new int[1024];\r\n\
168for(i in arr) i = rand();\r\n\
169map1(arr, <int ref x>{ *x = -*x; });\r\n\

Callers

nothing calls this directly

Calls 1

fFunction · 0.70

Tested by

no test coverage detected