4 ms·
Good article. 2 suggestions: 1. you mention that passing by value may be faster. The Vector2D function would be a good example for this, because the floats may
by eska 3y ago
Good article. 2 suggestions:
1. you mention that passing by value may be faster. The Vector2D function would be a good example for this, because the floats may be passed through registers instead of memory in certain ABIs. It’s a common mistake in linear algebra libraries. It also creates pure functions which leads to nicer to use APIs.
2. memset is strictly speaking not correct due to padding and null pointers not necessarily being 0. The newer = {} syntax solves this.