title: How to create boost multi_index key to a member of member?
body: <p>Let's say I have following:</p>
  
  <pre><code>struct foo {
     int i;
  };
  
  struct bar {
      foo f;
  };
  </code></pre>
  
  <p>is there a way to create a key to <code>f.i</code> (except wrapping to function) for container, holding <code>struct bar</code>?</p>
  
  <p>Straightforward way does not seem to work:</p>
  
  <pre><code>namespace mpi = boost::multi_index;
  typedef mpi::multi_index_container&lt;bar,
       mpi::indexed_by&lt; mpi::hashed_unique&lt;bar,
           mpi::member&lt; bar, int, &amp;bar::fo.i&gt;&gt;
  &gt; &gt; Foobar;
  </code></pre>