Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2005-12-02 19:21:04


Andreas Pokorny wrote:
> Hi,
> The default implementation of boost::fusion::pair<first,second> only stores
> an instance of second. I might need a fusion::pair which does not store
> that instance either, maybe that will cause trouble in several parts of
> fusion. At first I would like to explain what I am doing right now. At
> the moment I do work on an expression template framework, similiar to
> Eric Nieblers boost::proto, which was used to build boost::xpressive.
>
> I do extend that library by adding a rule system which enables the user
> to define the allowed operations of a certain domain. To simplify and
> generalize the rule writing process, every node in the expression tree
> has a fusion::map<> which is supposed to hold some meta information.
> E.g. in the matrix vector domain, that attribute container of a binary
> node returned by binary plus, might look like that:
> map< pair<domain_tag, linear_algebra_domain>
> , pair<operator_tag, plus_tag>
> , pair<category_tag, column_vector_tag>
> , pair<dimension_tag, dynamic::dimension>
> , pair<element_type_tag, float>
> >
> There are entries in the map that do not require runtime data at all,
> for these entries all information is coverd by the second template
> parameter of pair. And others like the dimension_tag which require
> an instance of the second type stored in the container.
>
> How can I acchieve that with fusion?

If both the key and the data need to be just types, then what
immediately comes to my mind is an mpl::map. What am I missing?
Pure types == MPL. Half type/data == Fusion.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk