title: Dynamicly setting which parameter to extract
body: <p>Having structure </p>
  
  <pre><code>struct Person{
     Person(int a , int i):age(a),id(i){};
     int age;
     int id;
  }
  </code></pre>
  
  <p>Is it possible to pass which argument to exctract as argument in function? Something like</p>
  
  <pre><code>int extract( Person * p , param ){
      return p -&gt; param;
  } 
  </code></pre>
  
  <p>which would return id , if used it like</p>
  
  <pre><code>extract( p , "id" )
  </code></pre>
  
  <p>and age if i used it like</p>
  
  <pre><code>exctract(p , "age")
  </code></pre>
  
  <p>Is something like this possible in c++?</p>