Boost logo

Boost Users :

From: Robert Dailey (rcdailey_at_[hidden])
Date: 2007-11-16 18:48:43


Hi,

I'm looking for a complete compile-time constant map container that uses
types as keys and integral constants as values. For example:

typedef map< pair<float, 90>, pair<unsigned int, 3> > mapType;
unsigned int value = get_value<mapType, float>::value;

The above code is PSEUDO CODE only. It is supposed to give you an idea of
what I'm looking for. I tried using boost::fusion::map, however the
fusion::pair object expects a TYPE as the second template argument, so I
can't specify integral values. Could someone provide a code example that
achieves the above? Note that I should be able to do the following as well:

typedef map< pair<float, 90>,
              pair<unsigned int, 3>
> mapType;

class foo
{
    // This would result in 'value' being the integral number 90.
    static const unsigned int value = get_value<mapType, float>::value;
}



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