Hello!

I have a question to this construct:


template <typename contractType, typename treeType>
class TreeImplBase;

Each specialization of these holds a
static std::map< boost::tuple<int,enum1,enum2,enum3>, const TreeImplBase* >;
which contains the list of the derived template classes.

How can you instantiate a pointer to the class temlate? Class template is an incomplete type. You will not be able to specify a pointer to it.

I think you should use boost::fusion inplace. This lib, offers a compile time map (if you map the same time to an instance of it, use a fusion set), which can map a type to an instance. This is what you need.

http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/sequences/containers/map.html
http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/sequences/containers/set.html
 


Any comments are appreciated,

Perhaps this is a known design pattern,
perhaps there is an easier way of doing this,
perhaps there is a boost library which helps with this,


Good Luck,
Ovanes