title: generic lookup method?
body: <p>I'd like a generic method for retrieving the data from a vector.</p>
  
  <p>I have a the following class and vector:</p>
  
  <pre><code>class myClass
  {
      public:
  
      myClass(int myX, float myZ, std::string myFoo)
          : x ( myX )
          , z ( myZ )
          , foo ( myFoo )
      {
  
      }
      myClass()
      {
  
      }
  
      int x;
      float z;
      std::string foo;
  
  } ;
  std::vector &lt; myClass &gt; myVector;
  </code></pre>
  
  <p>(The complete code can be seen here: <a href="http://codepad.org/iDD1Wme5" rel="nofollow noreferrer">http://codepad.org/iDD1Wme5</a> )</p>
  
  <p>In this example I would like to be able to retrieve objects in the vector based on the "z" or "foo" members without having to write another 2 functions similar to "FindDataById".</p>
  
  <p>Is that possible?</p>