Is there a way to inherit from Boost multi index container in C++?
<p>I'm looking for a way to create a base container class that inherits the functionality of the boost multi index container. I want to be able to add other functions to this base class and create other classes that can use this base class's functions and utilize boost's multi index container. </p>

<p>I tried something like:</p>

<pre><code>template &lt; class D, E &gt;
class BoostModelContainer : public boost::multi_index_container&lt;D, E&gt;
{
public:
    D* AddItem( const D&amp; item)
    {
        //code here
    }
};
</code></pre>

<p>and then created other classes inheriting the base class like:</p>

<pre><code>class ExampleContainer : public BoostModelContainer&lt; CItem,
boost::multi_index::indexed_by&lt;
  boost::multi_index::ordered_unique&lt; 
     boost::multi_index::tag&lt;id_tag&gt;, boost::multi_index::member&lt; CItem, ItemId, &amp;CItem::m_id &gt; &gt;,
  boost::multi_index::ordered_unique&lt; 
     boost::multi_index::tag&lt;name_tag&gt;, boost::multi_index::member&lt; CItem, String, &amp;CItem::m_name &gt; &gt;
  &gt;
&gt;
</code></pre>

<p>But this wouldn't compile. Does anyone have any other ideas or know how to get this to work? </p>

<p>Thank you!!</p>