How to erase node from deque?

  • Thread starter Robert Sturzenegger
  • Start date
R

Robert Sturzenegger

// Hello!

typedef deque<int> D;
typedef D::iterator Iter;

D d;
Iter iter;

// here hundreds of elements pushed back to d

int myNode = d[100];

// Here I want to erase the node with index 100. If I had the iterator of
this node,
// I would use d.erase(iter); But how can I get the iterator? Or is there
another way
// to erase this node?

// Thanks a lot!
// Robert Sturzenegger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

copying elements from a <list> to <deque> 13
How to erase stringstream buffer? 0
multimap erase 4
deque and thread-safety 0
initializing an array from iterators 1
Vector Erase 3
Chatbot 0
deque 0

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top