Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2008-01-23 18:02:01


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



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net