title: When implementing Trees/Heaps/Lists etc, why should a `find` method return an iterator to the object instead of the obect itself?
body: <p>I see a lot of different C++ programmers more knowledgeable than myself do this all the time in their data structure implementations. For example in <a href="http://www.keithschwarz.com/interesting/code/?dir=avl-tree" rel="nofollow">this AVL tree implementation</a>, </p>
  
  <pre><code>/**
  * iterator find(const Key&amp; key);
  * const_iterator find(const Key&amp; key);
  * Usage: if (myAVLTree.find("Skiplist") != myAVLTree.end()) { ... }
  * -------------------------------------------------------------------------
  * Returns an iterator to the entry in the AVL tree with the specified key,
  * or end() as as sentinel if it does not exist.
  */
  iterator find(const Key&amp; key);
  const_iterator find(const Key&amp; key) const;
  </code></pre>
  
  <p>I'm trying to figure out in what situation this would be more useful than just returning the value that corresponds to key. </p>
  
  <p>If I were to adopt this into my own implementations (assuming I was designing some sort of container) when would it benefit me to do so?</p>