title: Boost.MultiIndex: How to make an effective set intersection?
body: <p>assume that we have a <code>data1</code> and <code>data2</code>. How can I intersect them with <code>std::set_intersect()</code>?</p>
  
  <pre><code>struct pID
  {
      int           ID;
      unsigned int  IDf;// postition in the file 
      pID(int id,const unsigned int idf):ID(id),IDf(idf){}
      bool operator&lt;(const pID&amp; p)const { return ID&lt;p.ID;}
  };
  
  struct ID{};
  struct IDf{};
  
  typedef multi_index_container&lt;
      pID,
      indexed_by&lt;
      ordered_unique&lt;
      tag&lt;IDf&gt;,  BOOST_MULTI_INDEX_MEMBER(pID,unsigned int,IDf)&gt;,
      ordered_non_unique&lt;
      tag&lt;ID&gt;,BOOST_MULTI_INDEX_MEMBER(pID,int,ID)&gt; &gt;
      &gt; pID_set;
  
  ID_set data1, data2; 
  Load(data1); Load(data2);
  
  pID_set::index&lt;ID&gt;::type&amp; L1_ID_index=L1.data.get&lt;ID&gt;();
  pID_set::index&lt;ID&gt;::type&amp; L2_ID_index=L2.data.get&lt;ID&gt;();
      // How do I use set_intersect?
  </code></pre>