Boost logo

Boost Users :

From: Duane Murphy (duanemurphy_at_[hidden])
Date: 2004-08-23 16:03:15


--- At Mon, 23 Aug 2004 15:48:47 -0400, Stephen torri wrote:

>Can you use a std::map or sgi hash_map to construct the table?

This seems like an enormous hassle. Something has to build the table and
that table will likely be mostly static (but I can see something being
more dynamic.)

Which brings me to my inquiry. I have struggled to work out how one might
do a static map. I can lay one out in a table, but I would like it to
work like a map.

e.g

struct useful_data_t
{
    std::string useful_data;
};

struct useful_data_map
{
    int key;
    useful_data_t value;
};

static useful_data_map[] =
{
    { 1, { "useful data 1" } },
    { 2, { "useful data 2" } }
};

Now I would like to use this like a std::map or tr1::hash_map;

Does boost have anything like this? Other suggestions?

 ...Duane


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