C++ What would be the fastest way to search and count for a specific element within a std::vector?
<p>How do we search for a specific element and count it within a std::vector? It MUST be fast. Please help, thank you.</p>

<p>This is what I have so far:</p>

<pre><code>// Lets assume the Database is sorted (which it will be)
std::vector&lt; std::string &gt; Database( 3 );
Database.push_back( "Password123" );
Database.push_back( "HelloWorld!!!" );
Database.push_back( "HelloWorld!!!" );
//...

std::string Password = "HelloWorld!!!";

// Search and count Password?
// Should return true and 2
</code></pre>

<p>Oh and I heard indexing is slower than iterator. Is it true?</p>
