Need the position/index of a std::set element on find
<p>I use a std::set to sort a vector of unordered duplicate values. Every time I find an element in my set, I need to know the position (index) of the element as well. There are a lot of elements (hundreds of thousands) in my set, and using std::distance() gives me abysmal performance.</p>

<p>Is std::distance the only way to go? </p>
