Vee

Italy

Age: 18

May
13
accepted Foreach range iteration over a vector<int> - auto or auto&?
May
13
asked Foreach range iteration over a vector<int> - auto or auto&?
Apr
22
asked vector<unique_ptr> resizing with push_back - how does it work?
Apr
11
awarded Fanatic
Apr
9
awarded Popular Question
Apr
9
accepted Getting cells in a 2D grid between two angles
Apr
8
comment std::vector faster than std::unordered_set?
@ChristianRau added.
Apr
8
revised std::vector faster than std::unordered_set?
added 273 characters in body
Apr
8
comment std::vector faster than std::unordered_set?
@stardust_ I understand. Do you think there is any way to speed up this method? Maybe using a custom stack allocator could improve the performance?
Apr
8
comment std::vector faster than std::unordered_set?
I tried it, but the performance is slower than what I currently have.
Apr
8
comment std::vector faster than std::unordered_set?
As I only care about returning a collection of unique Body*, I didn't use "contains" or "find" on unordered_set. I just used insert expecting it to only be filled with unique elements.
Apr
8
comment std::vector faster than std::unordered_set?
@ChristianRau Nope, I removed the "contains" part.
Apr
8
comment std::vector faster than std::unordered_set?
@stardust_ Profiler shows "getBodiesToCheck()" method as the bottleneck. If I use the std::vector version, the bottleneck inside getBodiesToCheck() (bottleneck of the bottleneck :P) is the call to "contains"
Apr
8
asked std::vector faster than std::unordered_set?
Apr
7
comment Getting cells in a 2D grid between two angles
Good idea. I understand how to do it for one quadrant, but I'm confused on how I should handle different quadrants, or a situation where a ray is in a quadrant and the other ray is in another quadrant. What if the rays make a 180° angle? How can I "walk" the inner cells for the quadrants in the middle?
Apr
6
asked Getting cells in a 2D grid between two angles
Apr
4
awarded Yearling
Apr
2
awarded Nice Question
Apr
2
accepted Does a C++11 foreach loop condition get evaluated every cycle?
Apr
2
asked Does a C++11 foreach loop condition get evaluated every cycle?
1 2 3 4 5