gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash/server/asobj xmlnode.cpp


From: strk
Subject: Re: [Gnash-commit] gnash/server/asobj xmlnode.cpp
Date: Sat, 3 Mar 2007 16:55:29 +0100

On Sat, Mar 03, 2007 at 01:03:19PM +0000, Martin Guy wrote:

> +// Query: here ".begin" and ".end" are used; elsewhere ".front" and ".back".
> +//   What's the difference?

.begin() and .end() return *iterators*.
.back() and .front() return references to *elements*

iterator firstIt = container.begin();
element firstEl = container.front();
assert(*firstIt == firstEl);

iterator lastIt = container.rbegin(); // reverse begin
element lastEl = container.back();
assert(*lastIt == lastEl);

iterator onePastLast = container.end(); 
// dont dereference *onePastLast !!


--strk;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]