This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Large map<srting,string> Initialization


* Tom Browder:

> 1.  Is there a better way to initialize such a map?

You could use a (preferably sorted) array of {"long_string1",
"long_string_val1"} structure values to initialize the map.  Depending
on your needs, you might be able to skip the map altogether and just
use a binary search to locate the correct strings.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]