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.
I tried something like:
template < class D, E >
class BoostModelContainer : public boost::multi_index_container<D, E>
{
public:
D* AddItem( const D& item)
{
//code here
}
};
and then created other classes inheriting the base class like:
class ExampleContainer : public BoostModelContainer< CItem,
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<
boost::multi_index::tag<id_tag>, boost::multi_index::member< CItem, ItemId, &CItem::m_id > >,
boost::multi_index::ordered_unique<
boost::multi_index::tag<name_tag>, boost::multi_index::member< CItem, String, &CItem::m_name > >
>
>
But this wouldn't compile. Does anyone have any other ideas or know how to get this to work?
Thank you!!