Boost logo

Boost Users :

From: Lee Crabtree (lcrabtree_at_[hidden])
Date: 2005-09-21 12:03:25


I intended for the map to stay completely static, that is, no inserts or
deletes were going to be performed. I was going to use it for barcode
key/value pairs (as in a 0 in Code 39 has the hex code 0x51DD), since there
isn't really an easy way to figure out what goes where. Since I couldn't
figure this out, I had to opt for a static array and an enumeration of the
names in the proper order. Kind of a crock, but you do what you can, I
suppose.

Lee

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Gottlob Frege
Sent: Tuesday, September 20, 2005 6:42 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] static maps (was trouble with boost::assign)

On 9/20/05, boost-users-request_at_[hidden] <
boost-users-request_at_[hidden]
<mailto:boost-users-request_at_[hidden]> > wrote:

        Message: 2
        Date: Mon, 19 Sep 2005 12:35:08 -0500
        From: "Lee Crabtree" <lcrabtree_at_[hidden]>
        Subject: [Boost-users] trouble with boost::assign
        To: boost-users_at_[hidden]
        Message-ID: <dgmsos$amg$1_at_[hidden]>
        
        Hi, I'm trying initialize a static map with map_list_of. Something
along the
        lines of:
        
        map<int,int> blarg = map_list_of(1, 2);
        
        However, when I go to compile, I receive the following error:

...

        Lee Crabtree
        
        
        

Can't help you with the error, unfortunately, but just wondering - does this
map *remain* static after initialization? ie Do you do any inserts or
deletes after init? I wrote a static_map<K, T> that is constructed from a
static array, which I use for those cases where the map doesn't change, and
I was just wondering how useful people thought it might be - ie how often do
you have maps that never change after initialization from static data?


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