rkts
searching Neon…
- 1.▲
- 2.▲
- 3.▲
- 4.▲
- 5.▲
- 6.▲
10 ms·
- 1.▲
- 2.▲
- 3.▲
- 4.▲
- 5.▲
- 6.▲
- 7.▲
- 8.▲
- 9.▲
- 10.▲
- 11.▲
- 12.▲
- 13.▲
- 14.▲
- 15.▲
- 16.▲
- 17.▲
- 18.▲
C++ version: template<typename T>
void zap (T (*f)(T x), T &x) { x = f(x); }
Example: int square (int x) { return x*x; }
int foo[5] = {1,2,3,4,5};
zap<int>(square, foo[3]); // foo is now {1,2,3,16,5} - 19.▲
- 20.▲
- 21.▲
- 22.▲
- 23.▲
- 24.▲
- 25.▲
- 26.▲
- 27.▲
- 28.▲
- 29.▲
- 30.▲
More ›