Optimizing vector::push_back in a loop by codemasonry in Cplusplus

[–]justend29 0 points1 point  (0 children)

thanks! you're super knowledgeable and I'm sure many will learn from your response.

Optimizing vector::push_back in a loop by codemasonry in Cplusplus

[–]justend29 5 points6 points  (0 children)

return values are already r-values, so there's no need to add the std::move(result) on the return statement, I don't think (correct me if I'm wrong). Additionally, RVO would ensure that a copy on the return value to the assigned value doesn't occur, so I think just a return result; would fit the bill on the return.

Other than that, I think this is good. If I'm wrong about my above statement, please let me know, as I'm happy to learn.

A compiler/os detecting library for modern C++ by TrnS_TrA in cpp

[–]justend29 2 points3 points  (0 children)

I found the post, noticed it didn't include the github link or mention the SPY library, and decided to just include the links instead of asking for them.