Simple STL Q - heap vs. automatic

From: Mark P (not_at_my.real.email)
Date: 09/30/04


Date: Wed, 29 Sep 2004 18:05:29 -0700

I'm brand new to the STL.

Say I have a variable ms = new multiset<int>;
and I put a bunch of integer values into ms.
Now I want an interator starting from a certain value so I type:
multiset<int>::iterator iter = ms.find(4);

This makes iter an automatic variable. How would I do this if I wanted
to keep iter around? ie, How would I create this same iterator using a
"new" statement?

Thanks,
Mark



Relevant Pages

  • Re: Simple STL Q - heap vs. automatic
    ... > and I put a bunch of integer values into ms. ... > Now I want an interator starting from a certain value so I type: ... > This makes iter an automatic variable. ... if you want to keep the iterator around, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Marking an Iterator as Invalid?
    ... Another cricticism of the STL is that it lets you do this kind of thing ... without complaint: ...
    (alt.comp.lang.learn.c-cpp)