SFML community forums

Help => General => Topic started by: rasen58 on October 30, 2012, 01:56:25 pm

Title: How to return an iterator
Post by: rasen58 on October 30, 2012, 01:56:25 pm
I want to return an iterator from the beginning of a vector from another file.
std::vector<sf::Sprite> bigAsteroidV;
bigAsteroidV.begin();
What would the function header be for that?
Title: Re: How to return an iterator
Post by: Laurent on October 30, 2012, 02:06:40 pm
std::vector<sf::Sprite>::iterator pouet();
(read/write access)

std::vector<sf::Sprite>::const_iterator pouet() const;
(read-only access)

But returning an iterator is usually not a good solution. What are you trying to do?
Title: Re: How to return an iterator
Post by: masskiller on October 30, 2012, 02:53:18 pm
Also here you could answer this kind of questions on your own.

http://www.cplusplus.com/reference/stl/ (http://www.cplusplus.com/reference/stl/)

It's the documentation for all std C++ containers that use templates one way or the other as well as a bunch of other useful stuff.
Title: Re: How to return an iterator
Post by: rasen58 on October 30, 2012, 02:55:46 pm
Never mind, i realized i didnt need it. thanks anyway