C++ iterator of list
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6302706/c-check-if-iterator-belongs-to-a-list">C++: Check if iterator belongs to a list</a>  </p>
</blockquote>



<p>How can I check if an iterator recieved by function belongs to the right list?</p>

<pre><code>List&lt;double&gt; doublesList;
List&lt;double&gt; doublesList2;

// Can't mix iterators
ASSERT_THROW(ListExceptions::ElementNotFound, doublesList.remove(doublesList2.begin()));
ASSERT_THROW(ListExceptions::ElementNotFound, doublesList2.insert(5.0, doublesList.begin()));
</code></pre>

<p>I askes for the  case of my own Linked List and my own Iterator.
Thanks a lot.</p>
