If your values are iterable, then std::find should do just fine. If you plan on doing this search many times, you can sort your elements, and use std::binary_search for increased performance.
The simplest option would be to use an std::map though.
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 15 of 17
Threaded View
|
Click Here to Expand Forum to Full Width |