Boost logo

Boost :

From: jbandela_at_[hidden]
Date: 2001-07-20 21:54:20


Forgive me if I am being too naive. Provided you did not have to be
able to iterate over all associations, wouldn't template
specialization fill your needs.

template<class T> struct MyMap{};
template<> struct MyMap<Type1>{
typedef Type1 type;
typedef Value1 value;
};

Regards,

John R. Bandela

--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> Hi All
>
> I'm looking for a good facility for the following functionality:
>
> a compile-time Map: type => (type, value)
>
> The idea is that given a Map object and a key type, I should be
able to
> extract a corresponding value at compile-time.
>
> I've been looking around at existing facilities, and none of them
seem to
> quite fit the bill. For example, the recently accepted boost tuple
library
> doesn't seem to be designed for this, although I could be wrong.
>
> Of course I could code it myself, but I'd rather re-use than invent.
>
> Pointers appreciated,
> Dave


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