C++

C++ implements vector & set libraries. Which are fascinating.

On iterators, Vectors use random access iterators while sets use bidirectional iterators. The difference: random access iterators are treated like an indexed array thereby allowing some basic integer operation. Bidirectional iterators are more strict, thereby to reference the next pointer requires it++, and not it+1.

Set is already a tree, so many methods are already implemented conveniently as find, sort, etc.

This entry was posted in Technical. Bookmark the permalink.

One Response to C++

  1. timlyg says:

    To access global variables when there were already variables with the same names locally, prefix variable with ::. Thus, x referred to by ::x.
    This is called the unary scope resolution variable

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.