[geeks] Quick VC++ question

Drew Schatt schatt at schatt.com
Mon Oct 28 13:47:24 CST 2002


This code fails on Sun's C compiler (Forte, at least version 7) as well.
It's a gcc/g++ specific "feature", I think.  You might want to use -ansi
-pedantic options on your gcc code to make sure that you're using actual
ansi code.
	I think that you'll have to declare a hash_map type, and use that.
hash_map is not a C/C++ built-in (as far as I know, never saw it one of my
Stroustrep(sp?) books).
	-Drew

On Mon, 28 Oct 2002, Joshua D Boyd wrote:

> I have a block of code that uses a hash_map:
> hash_map<const char*, Attribute, hash<const char*>, eqstr> attributes;
> and I'm including
> #include <hash_map>
>
> Now, this works fine with g++ on irix and linux, and I got the
> documentation about it from SGI's web site.  But when I try to use it in
> VC++ 6.0, it fails.  It seems that there is no hash_map include file,
> nor is there a hash include file.  There is a map include file, but my
> understanding is that map is to be inherited from, not to be used
> directly, although some web sites make it appear you can use it directly
> (though their code then fails).
>
> Can anyone suggest what I'm doing wrong (other than that I'm using
> MSVC++ in the first place)?
>
>
> --
> Joshua D. Boyd
> _______________________________________________
> GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks



More information about the geeks mailing list