Boost logo

Boost Users :

From: Joel de Guzman (joel_at_[hidden])
Date: 2007-03-19 20:09:14


Christian Henning wrote:
> Hi there, next metaprogramming problem. Is it possible to extract a
> tagged type from a map?
>
> namespace fields
> {
> struct _id_;
> struct _name_;
> struct _birthday_;
> struct _address_id_;
> }
>
> namespace tags
> {
> struct _primary_key_;
> struct _foreign_key_;
> struct _value_;
> }
>
> typedef fusion::map< fusion::vector< fields::_id_ , std::string,
> tags::_primary_key_ >
> , fusion::vector< fields::_name_ ,
> std::string, tags::_value_ >
> , fusion::vector< fields::_birthday_ ,
> std::string, tags::_value_ >
> , fusion::vector< fields::_address_id_,
> std::string, tags::_foreign_key_ >
> > table_type;
>
> int main()
> {
> /// how to get the primary key type vector
> }

at_key<fields::_id_>(m) ???

> I was looking at fusion's filter_view but that is only available for
> non-metaprogramming.

Not sure what you mean.

Regards,

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

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