Find index of an element in a vector given a pointer to that element
<p>I have a vector of structs, like so: <code>std::vector&lt;mystruct&gt; elems</code>.</p>

<p>If I then have a <code>mystruct</code> pointer, which I <em>know</em> is pointing to one of the elements of <code>elems</code>, how can I get its index within <code>elems</code>?</p>
