Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2007-03-21 15:12:02


I think the following example serves better for understanding my
problem. I don't think that at_key is the right way to go. Instead,
I'm looking for something like that finds me the right key for a
value.

#include <boost/fusion/sequence.hpp>

using namespace std;
using namespace boost;

namespace fields
{
   struct id {};
   struct name {};
   struct address {};
   struct birthday {};
}

namespace tags
{
   struct pri {};
   struct val {};
}

typedef fusion::map< fusion::pair< fields::id, tags::pri >
                   , fusion::pair< fields::name, tags::val >
                   , fusion::pair< fields::address, tags::val >
                   , fusion::pair< fields::birthday, tags::val >
> table;

int _tmain(int argc, _TCHAR* argv[])
{
   BOOST_STATIC_ASSERT((is_same< fusion::result_of::???< table
                                                          , tags::pri
>::type
                                       , fields::id
>::value ));

   return 0;
}

Does that makes sense, now?

Christian


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