C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

references into a deque

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Jun 28, 2006 3:40 pm    Post subject: references into a deque Reply with quote



Inserting or deleting an element at the front or back of a deque does
not invalidate
references and pointers to other elements in the deque.

I only see this mentioned explicitly in the standard for insert and
erase in 23.2.1.3 (at least
in the final draft from 1998).

Where is it mentioned for push_back, push_front, pop_back, pop_front?


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
johnchx2@yahoo.com
Guest





PostPosted: Thu Jun 29, 2006 9:10 am    Post subject: Re: references into a deque Reply with quote



pr2345 (AT) gmail (DOT) com wrote:

Quote:
Inserting or deleting an element at the front or back of a deque does
not invalidate
references and pointers to other elements in the deque.

I only see this mentioned explicitly in the standard for insert and
erase in 23.2.1.3 (at least
in the final draft from 1998).

Where is it mentioned for push_back, push_front, pop_back, pop_front?

23.1.1/12 (table 6Cool defines the operational semantics of push_back and
push_front in terms of insert, and those of pop_back and pop_front in
terms of erase. Therefore the guarantees applicable to insert and
erase also apply to these functions.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Guest






PostPosted: Thu Jun 29, 2006 9:10 am    Post subject: Re: references into a deque Reply with quote



pr2345 (AT) gmail (DOT) com wrote:
Quote:
Inserting or deleting an element at the front or back of a deque does
not invalidate
references and pointers to other elements in the deque.

I only see this mentioned explicitly in the standard for insert and
erase in 23.2.1.3 (at least
in the final draft from 1998).

Where is it mentioned for push_back, push_front, pop_back, pop_front?

IIRC, that follows from the definition of those functions. They are
equivalent
to insert and erase at either end. Hence, they invalidate the same
elements
as the equivalent insert or erase statement would.

HTH,
Michiel Salters


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Bo Persson
Guest





PostPosted: Thu Jun 29, 2006 4:22 pm    Post subject: Re: references into a deque Reply with quote

<pr2345 (AT) gmail (DOT) com> skrev i meddelandet
news:1151432353.758349.183230 (AT) p79g2000cwp (DOT) googlegroups.com...
Quote:
Inserting or deleting an element at the front or back of a deque
does
not invalidate
references and pointers to other elements in the deque.

I only see this mentioned explicitly in the standard for insert and
erase in 23.2.1.3 (at least
in the final draft from 1998).

Where is it mentioned for push_back, push_front, pop_back,
pop_front?


In the 2003 edition of the standard, table 68 (23.1.1) defines these
funtions in terms of insert and delete, like

a.pop_front() a.erase(a.begin())

etc.


That must mean that the same guarantees hold.


Bo Persson



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Carl Barron
Guest





PostPosted: Thu Jun 29, 2006 4:32 pm    Post subject: Re: references into a deque Reply with quote

In article <1151432353.758349.183230 (AT) p79g2000cwp (DOT) googlegroups.com>,
<pr2345 (AT) gmail (DOT) com> wrote:

Quote:
Inserting or deleting an element at the front or back of a deque does
not invalidate
references and pointers to other elements in the deque.

I only see this mentioned explicitly in the standard for insert and
erase in 23.2.1.3 (at least
in the final draft from 1998).

Where is it mentioned for push_back, push_front, pop_back, pop_front?

table 68 on page 464 in the approved standard and in the 2006 draft.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.