rookie
rookie

Reputation: 7863

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?

Upvotes: 4

Views: 2141

Answers (4)

SingleNegationElimination
SingleNegationElimination

Reputation: 156158

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.

Upvotes: 0

Daniel Lidström
Daniel Lidström

Reputation: 10260

You can also browse the SGI STL online here: http://www.sgi.com/tech/stl/set.

Upvotes: 0

icecrime
icecrime

Reputation: 76755

  • 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.

Upvotes: 1

Andreas Brinck
Andreas Brinck

Reputation: 52519

If you have a C++ compiler you should be able to look in the <set> header file.

Upvotes: 0

Related Questions