473,513 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

STL hash_map

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
1 9359

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
9953
by: Florian Liefers | last post by:
"Hello World\n", i get error C2143 (Syntaxerror, missing ';' before '<') using the following code: #include <hash_map> struct eqstr { bool operator()(const char* s1, const char* s2) const
10
4718
by: Jon Cosby | last post by:
I need help in hashmaps. Why doesn't this work: #include <hash_map> hash_map <int, string> hm1; typedef pair <int, string> pr; hm1.insert(str_pair(1, "Hello")); It compiles, but crashes at runtime, pointing to something in xhash.
5
8601
by: peter_k | last post by:
Hi I've defined hash_map in my code using this: ------------------------------------------- #include <string> #include <hash_map.h> & namespace __gnu_cxx {
3
3826
by: kony | last post by:
Hi there, I would much appreciate your help with the following problem. Below is the code that uses a hash_map. I want to release all the memory occupied by the hash_map for other use. Apparently clear() function is not working and the trick with swap() is half working. Does anybody know how to deallocate the hash_map? Thanks in advance. ...
1
1777
by: Axel Gallus | last post by:
Hello, i have a question concerning STL non-standard hash_maps under Visual Studio 2005: Microsoft STL requires a "hash_compare" object for hash_maps: template <class Key, class Type, class Traits=hash_compare<Key, less<Key, class Allocator=allocator<pair <const Key, Type > class hash_map
2
4266
by: Amit Bhatia | last post by:
Hi, I am trying to use hash maps from STL on gcc 3.3 as follows: #ifndef NODE_H #define NODE_H #include <ext/hash_map> #include "node_hasher.h" class Node; typedef hash_map<pair<int,int>, Node, Node_HasherLoc_Tree;
4
3382
by: James Kanze | last post by:
On Jul 16, 10:53 pm, Mirco Wahab <wa...@chemie.uni-halle.dewrote: It depends. You might like to have a look at my "Hashing.hh" header (in the code at kanze.james.neuf.fr/code-en.html---the Hashing component is in the Basic section). Or for a discussion and some benchmarks, http://kanze.james.neuf.fr/code/Docs/html/Hashcode.html. (That...
5
3359
by: frankw | last post by:
Hi, I have a hash_map with string as key and an object pointer as value. the object is like class{ public: float a; float b; ...
2
8106
by: marek.vondrak | last post by:
Hi, I am wondering if there are any functional differences between SGI's hash_map and tr1's unordered_map. Can these two containers be interchanged? What would it take to switch from hash_map to unordered_map? Thank you. -Marek
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.