4 ms·
vector S(vector o,vector d, unsigned int& seed) {} int T(vector o,vector d,float& t,vector& n) {} not sure why he's copying the vectors here.
by halayli 13y ago
vector S(vector o,vector d, unsigned int& seed) {}
int T(vector o,vector d,float& t,vector& n) {}
not sure why he's copying the vectors here.
- hamidr 13y agoAlso, he's mostly passing by value.
- bstamour 13y agoPassing by value in C++ can offer speed increases when the function will be copying the object anyways, due to move semantics, constructor eliding, etc.
- Sharlin 13y agoWhy not? Note that these are not std::vectors. Copying 12 bytes will probably be cheaper than indirect access through a reference.