On Jul 29, 1:02=A0pm, "Jim Langston" <tazmas...@[EMAIL PROTECTED]
> wrote:
> "Andrew Falanga" <af300...@[EMAIL PROTECTED]
> wrote in message
>
> news:7566a52d-d393-4ddf-b93f-46cd51e69f55@[EMAIL PROTECTED]
>
> > Hi everyone,
>
> > I'm finally writing some code to use a map. =A0I've never used them
> > before so this is exciting. =A0I'm wondering what exception does the
> > map<> container object through if a key requested does not exist in
> > the map? =A0I don't have a good reference for the STL (I'm using my
C++
> > programming book, "Object-Oriented Programming in C++," by Robert
> > LaFore which has already proven inaccurate a few times and doesn't
> > cover in depth the STL). =A0The program I'm writing I definitely want
i=
t
> > to recover if the key isn't found in the map.
>
> AFAIK std::map doesn't throw at all if the key is not found. =A0If you
ar=
e
> using .find() then it will return and iterator pointing to .end(). =A0If
=
you
> are using [] then it will add the element. =A0No throwing involved.
Wow! I just tried it in a dummy test program and it doesn't throw and
error at all. This is cool. I was just assuming that some sort of
error was thrown. I'm going to have to invest in a good resource book
on the STL.
Thanks again,
Andy


|