Omgili - forum search, search forums  
  

Discussions about iterator iter

Displaying 1 - 10 out of 54,071 discussions.  
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
(Note: I'm writing this project for learning only; comments about it being redundant are... uh, redundant. ;) I'm trying to implement a random access iterator, but I've found very little literature on the subject, so I'm going by trial and error combined...
Started by on , 5 posts by 5 people.  
Add one code): exscape::string::iterator operator+(exscape::string::iterator it, size_t n) { return it += n; } exscape::string::iterator operator....
Your + operator returns a const iterator, but you don't have a const operator* .
Suppose I want to implement in C++ a data-structure to store oriented graphs. Arcs will be stored in Nodes thanks to STL containers. I'd like users to be able to iterate over the arcs of a node, in an STL-like way. The issue I have is that I don't want...
Started by on , 11 posts by 11 people.  
An alternative would be to templatize Node may want to look into using boost's iterator facades and adaptors where you can define your own::vector<Arc*> incoming_; public: typedef....
That forwards all its methods to std::vector::iterator.
I recently learned about the right way to work with reverse iterators in C++ (specifically when you need to erase one). (See this question and this one .) This is how you're supposed to do it: typedef std::vector<int> IV; for (IV::reverse_iterator...
Started by on , 3 posts by 3 people.  
Std::find(foo.rbegin(), foo.rend(), L'a').base()....
The reason for reverse iterators is that the standard algorithms do not know(), foo.end(), L'a'); // Returns an iterator pointing // to the first a character.
iterator (Item 26).
Ask your Facebook Friends
Hi, I'm using std::map to store a lot of elements (pairs of elements) and I have a "little" doubt, what is more efficient to iterate all elements over my std::map, iterator or reverse_iterator? Thank's. Salu2.
Started by on , 6 posts by 6 people.  
Std::reverse_iterator is just a template container, a forward iterator might interact very slightly better with the cache than a reverse iterator to use a reverse_iterator....
Evil." - Donald Knuth There will likely be no difference .
My workmate claims that for object types preincrement is more efficient than post increment e.g. std::vector<std::string> vec; ... insert a whole bunch of strings into vec ... // iterate over and do stuff with vec. Is this more efficient than the...
Started by on , 7 posts by 7 people.  
What good is that? Me: That's great! It means nearly all your time prefer the prettiness of iterator-incrementing....
Jacob Postincrement must return the value the iterator had BEFORE it was incrementing; so in some iterator-increment code.
I would like to get an istream_iterator-style iterator that returns each line of the file as a string rather than each word. Is this possible?
Started by on , 6 posts by 6 people.  
An iterator is just://www.drdobbs.com/cpp/18....
It's not that hard.
It is easy to have istream_iterator do what you want: namespace_inserter(v)); return 0; } You could write your own iterator.
By someone else in a previous thread.
Hi, I have a class called Action , which is essentially a wrapper around a deque of Move objects. Because I need to traverse the deque of Moves both forward and backwards, I have a forward iterator and a reverse_iterator as member variables of the class...
Started by on , 6 posts by 6 people.  
You....
Beware that this isn't an iterator an iterator, then you would do something like std::deque<Move>::const_iterator Current() const, rbegin and rend ).
A member base() which returns a corresponding forward iterator.
I'm trying to get my head around SPL iterators and I've come up with 2 ways to handle it. I see the first version to be less complicated but the second version has composition feel to it (I think). What am I not seeing is which one is preferable over ...
Started by on , 7 posts by 7 people.  
The collection doesn'....
For instance, you may want an iterator that skips candy with nuts (though the typical case is to want one.
I would agree.
I think you should keep your collections separate from your iterators.
The iterator.
Why does the Iterator interface not extend extend Iterable ? The iterator() method could simply return ' this '. Is it on purpose or just an oversight of Java's designers? It would be convenient to be able to use a for-each loop with iterators like this...
Started by on , 5 posts by 5 people.  
Iterable implys that one may obtain an iterator from an object to traverse over its elements - and there's no need to iterate over a single instance....
Because an iterator generally points to a single instance in a collection.
Is it possible to iterate through until the end of list in main() function using the const_iterator? I tried using iter->end() but i can't figure it out. #include <list> #include <string> using std::list; using std::string; class list_return...
Started by on , 3 posts by 3 people.  
You need a function....
} There is no automatic way to know the end of the list given an iterator.
This: for (std::list<std::string>::const_iterator iter = lr.get_list(); iter != lr.get_list_end(); ++iter) { //...
Page: 1   2   3   4   5   6   7   8   9   10  
Related Searches
includextree line 293 map set iterators incompatible   
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost