This question already has answers here:
Closed 13 years ago.
Possible Duplicates:
Hashtable in C++?
can anybody offer a simple hash_map example in C++?
Does the STL contain an implementation of a hashtable?
If so, can you provide a brief example of how to use it?
Current standard implementation doesn't, STL::TR1 does, see Unordered Map.
Most modern compilers have a TR1 implementation, if that fails, you may always use the Boost TR1 implementation.
MSVC has it for VS2008 via service pack 1
GCC has it shipped with 4.x, but you can make it work with 3.4.x too AFAIR
Usage is almost the same as with a std::map.
While not officially part of the STL standard, hash_map and hash_set are commonly used to improve searching times......
http://msdn.microsoft.com/en-us/library/0d462wfh%28VS.80%29.aspx
So, long story short--no .
A quick google came up with this description of hash_map.
Related
This question already has answers here:
What's the difference between "STL" and "C++ Standard Library"?
(7 answers)
Closed 8 years ago.
Recently I have read an article that saying STL was developed by Alexander Stepanov prior to standardize the C++ and, It was a library at that time, like boost is nowadays. So few questions came in to my mind.
Can we download and use STL same like boost nowadays
Did STL included in to C++ standard? If that
What are things of STL, not included to stdlib,
What are the thing not from STL, but in stdlib
Did STL disappeared after C++ standardize
Can we say "There is no STL,But only Standard Library in C++"
yes - you can get it from SGI here, though god only knows if it'll compile on the latest compilers, or a more recently maintained version called STLport here
there are differences, for example the SGI STL has a bit_vector, though whether that was introduced before or after versions of most of the STL elements were Standardised I can't remember; while the Standard library includes the whole iostreams facility which was never part of the STL
obviously not, though after the available compiler-shipped implementations of the Standard got increasingly reliable there's been no reason to pick up a non-Standard version for new development; some old code doubtless still uses the STL (and lots of other similar non-Standard libraries)
as much as you can say "there's no boost in C++"... it's not part of the Standard
"But only Stranded Library in C++" - was that intentional? ;-)
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Do I need to protect read access to an STL container in a multithreading environment?
I am using the C++ standard library which comes with (Linux) GCC or (Windows) VC.
Can anyone please say clearly whether or not this library is thread safe?
"Thread safe" is not a clearly-defined boolean property of a library. Some things can be done concurrently and others cannot.
Almost certainly if you were to ask a more detailed question specifying what it is you want to do, the answer would be "no, it is not thread-safe". But only almost.
If by "thread-safe" you mean something like the difference between Vector and ArrayList in Java, then C++ standard containers are non-thread-safe.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What's this STL vs. “C++ Standard Library” fight all about?
I am very much used to the term STL ("Standard Template Library") and I catch myself often using it when I really mean the C++ Standard Library. So, since almost everything in the C++(-11) Standard Library is a template nowadays, I wonder: Is there a definition what is STL and what is not, in the C++Standard-Lib? Maybe containers, streams, algorithms, etc?
Or should I just stop using the term "STL", because it's the historic one that SGI (correct?) used for their lib years back? It will be difficult...
STL has evolved into C++ Standard Library, it contained containers, iterators and algorithms but not streams. It is better not to use term "STL" it is the name of the old library.
This question already has answers here:
What C++ Smart Pointer Implementations are available?
(3 answers)
Closed 8 years ago.
These three are shared pointer classes from Qt, STL and Boost, respectively. They seem to be identical in functionality so I'm puzzled as to:
What are advantages and disadvantages of each of them?
Why do Boost and Qt versions even exist -- it was in STL already, why make your own?
How should I choose which one to use?
Look here for the answers to your questions.
QSharedPointer requires Qt, shared_ptr is standard and portable
std::shared_ptr is a standard replacement for boost::shared_ptr (that is, the boost one came first and it became standard)
Don't use QSharedPointer unless you have a Qt class that requires it. If you have a tr1, or C++0x implementation use std::shared_ptr, otherwise used boost::shared_ptr.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
C Analog To STL
Is there something like STL for C.
You can have a look at the glib, which provides lots of interesting features
well there is the C library of course :) but I do not see the use of templates for C
There's not really anything quite like the STL; but there are a lot of libraries. glib has been mentioned, but usually it's not always useable together with whatever libraries you are using for actually achieving what you want to do.