Yes, the problem with books are just that they can be difficult to find. So yes, they're all available on Amazon, but I don't live in USA, do I? No, sir.
EDIT: Awesome. I found it online. Too bad there's no index.
Yes, the problem with books are just that they can be difficult to find. So yes, they're all available on Amazon, but I don't live in USA, do I? No, sir.
EDIT: Awesome. I found it online. Too bad there's no index.
Yes, Effective STL. I don't know about the validity of the URL, though, so I'll let someone else judge. But it did turn up on the first page on Google, however:
http://www.avsnonline.net/library/download.php?id=623
If anyone knows an on-line available version of Josuttis book on STL...
I found this link:
http://books.google.com/books?id=n9V...bnail#PPR14,M1
You can browse through a lot of the book, it seems, but as for downloading it, nothing I can find.
Well when I looked for it almost a year ago it wasn't there.
Too bad they don't have an HTML version, so you can refer people to links to specific sections.
If you haven't used much STL or templates in the past, it helps to read it slowly and give yourself time to absorb it. I read it a couple of times already, to pick up the things I forgot after the first read.Originally Posted by manav
I just thought of another question:
Seeing as I want to improve my iterators, I would set up communication between the iterator and the base class who create the iterator. They would probably communicate via protected/private members.
This, of course, requires friend functions or a friend class to access those private or protected members. It's not possible to declare a friend from a template type from what I understand, so the iterator cannot directly make the base class a friend.
What I was thinking then, was to use a sort of helper class, or communication class. But the question is...
How would I go about making a customizable helper class? Or does it not need to be customized? The helper class would delegate the functions calls between the iterator and the base. Both the base and the iterator could make it friend, if it knew the actual name of this class (not passed as a template type, that is).
So... anyway, suggestions, if you wouldn't mind, as to how to accomplish this.
I was thinking I could use it to enhance the relationship between an iterator and its base class. An iterator should be used to specify a range within the base class, and not a range within the data stored in the class. So if it resizes, and data is moved, the iterator would be invalidated. The base class notifies the iterator of this and allows the iterator to set a new position within the new memory region. Or it could simply tell the iterator that it is now invalidated, to catch mistakes.
Another would be that the iterator can ask the parent for the value at pos X, allow for greater customization of the iterator (it could work better, with more classes). And the best of all is that it could ask the parent to set data, as well. This is especially useful in a ranged iterator which emulates iterator behaviour (since there's not 1 element to change, there's several).
I was thinking of specializing std::backward_copy too. But I would need to specialize a version which uses my iterators, which again would leave the work with the iterators (the iterator would have to do the work!). So by better communication with the base class, it could avoid doing
*dst++ = *src++;
Would would be inefficient.