By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,678 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,678 IT Pros & Developers. It's quick & easy.

STL hash_map

P: n/a
Hi All,

I am developing my code with Apache stdcxx. I am bound to use STL of
Apache only.
Now today I need hash_map in code but as I learned, it is not
available in Apache since it is not standard c++. Though it is
available with GNU STL.

The code module where I use hash_map will generate separate object
file during compilation. This code module is also using STL string.

What can I do now ?

I planned like this way:

1The code module that uses hash_map, I will link it statically with
GNU STL.
2The rest of the modules, which does not use hash_map, I will link it
dynamically with Apache STL.

By this approach my object size of GNU STL (which is linked statically)
is huge in size.

Can anybody please suggest me a better solution with following
conditions in mind?

- I must use hash_map.
- I must use Apache STL.

Dec 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

ja*****@gmail.com wrote:
Hi All,

I am developing my code with Apache stdcxx. I am bound to use STL of
Apache only.
Now today I need hash_map in code but as I learned, it is not
available in Apache since it is not standard c++. Though it is
available with GNU STL.

The code module where I use hash_map will generate separate object
file during compilation. This code module is also using STL string.

What can I do now ?

I planned like this way:

1The code module that uses hash_map, I will link it statically with
GNU STL.
2The rest of the modules, which does not use hash_map, I will link it
dynamically with Apache STL.

By this approach my object size of GNU STL (which is linked statically)
is huge in size.

Can anybody please suggest me a better solution with following
conditions in mind?

- I must use hash_map.
- I must use Apache STL.
Mixing two different standard libraries sounds like a nightmare
and may not even be possible.

Just use Apache STL and then a "third party" hash_map. By
third party I mean some code that is easily included and
compiled into your project.

If you can do this with the GNU hash_map (e.g. it's defined
withing a single header file) then go right ahead.

If not, you could use some other hash_map that fits my own
ease of use critria. Boost's hash_map comes to mind although
I don't think it's called a hash_map. I'd go with boost.

Good luck.

Dec 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.