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


Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top