Hello all,
Say I have a vector of objects and I want to return an object based on a pair of strings. The strings can be in either order Ie; A B==B A.
In general, what do you think is the best way to do this?
Thanks,
T.
Printable View
Hello all,
Say I have a vector of objects and I want to return an object based on a pair of strings. The strings can be in either order Ie; A B==B A.
In general, what do you think is the best way to do this?
Thanks,
T.
There can be varying opinion on what is the "best way".
http://www.cplusplus.com/reference/algorithm/find_if/
Regards,
Paul McKenzie
I think you have to provide more details to get a serious answer.
Edit: Sorry Paul, was typing a response but changed my mind before posting so your response was not accounted for.
You may want to consider a sorted vector or a map as stated above.