implementation of the set
Is it possible to find in the net the full implementation of the STL Set, particularly I'm interested in the iterator?
- Under Visual Studio, an easy way is to right click on a #include <set> and "Open Document" : the IDE will search the include paths for you and open up the file regardless of your installation directory
- The sources for libstdc++ are available and can be easily browsed online (as a matter of fact, I'm often referring to this site as a documentation) : the code for set can be found here.
If you have a C++ compiler you should be able to look in the <set> header file.
You can also browse the SGI STL online here: http://www.sgi.com/tech/stl/set.
If you are having a hard time locating the implementation of set, then you will probably find it very difficult to understand what you are reading when you eventually do find it. The STL is well known for being one of the hardest bits of C++ code to understand, and this is especially true of the more complex container classes it provides (std::find is actually pretty easy, by comparison).
Instead, it might be an easier task to look at some example code written for use by normal humans, instead of the inscrutable code found in the most common STL implementations. This looks promising, and compares pretty well with what std::set actually really does.