Re: [boost] Interest in a statically initialized map?

29 Jun
2006
29 Jun
'06
8:44 p.m.
Quick quesiton would be, is this static or done during runtime? The creation of the map is all done at compile time. The queries on the map are done at runtime. So you can have maps like so: // namespace scope static static_map<const char*, int, 2> map = { "Will", 28, "Joe", 30 };
// class scope class foo { static static_map<const char*, int, 2> map; }; static_map<const char*, int, 2> foo::map = { "Will", 28, "Joe", 30 }; // function scope void bar() { static static_map<const char*, int, 2> map = { "Will", 28, "Joe", 30 }; } all of which are initialized with their key\value pairs at compile time. --Meador
6922
Age (days ago)
6922
Last active (days ago)
0 comments
1 participants
participants (1)
-
meadori@bellsouth.net