0

I'm trying to grab the address of a specific node in an STL list. I have set up an iterator that successfully goes through each node, but I want to capture a specific nodes address so that I can edit it. I've created temporary variables that hold that nodes property, but it never actually applies these changes since its not a pointer, it just replicates the node and now there is two identical nodes.

                sf::VertexArray* temp;
                for (std::list<sf::VertexArray>::iterator it = vertexManager.begin(); it != vertexManager.end(); it++)
                {

                    temp = it;
                }

I get that this is going to capture each node and override the previous one, but I can't figure out the syntax to do this.

The code above gives the error

    Severity    Code    Description Project File    Line    Suppression State
Error (active)  E0413   no suitable conversion function from "std::_List_iterator<std::_List_val<std::conditional_t<true, std::_List_simple_types<sf::VertexArray>, std::_List_iter_types<sf::VertexArray, size_t, ptrdiff_t, sf::VertexArray *, const sf::VertexArray *, sf::VertexArray &, const sf::VertexArray &, std::_List_node<sf::VertexArray, void *> *>>>>" to "sf::VertexArray *" exists SFMLPractice2   C:\Users\----\Documents\-----\------\------\------\SFMLPractice2\SFMLPractice2\main.cpp 126 
BobbyT432
  • 51
  • 6

0 Answers0