If I have thousands of struct or class objects in a vector, how to find those that are needed, in a fast way? For example: Making a game, and I need fas
You should sort your vector and then use the standard library algorithms like binary_search, lower_bound, or upper_bound.
The above will give you a better compliexity than o(n) given by walk through of entire vector or by using standard library algorithm find.
o(n)