On Thu, 9 Jun 2005 23:41 , David Cournapeau <cournape(a)gmail.com> sent:
On 6/9/05, stefan kersten steve(a)k-hornz.de> wrote:
On Thu, Jun 09, 2005 at 10:31:35PM +0900, David
Cournapeau wrote:
_Z6vectorSt6vectorIiSaIiEE:
.LFB539:
.L2:
.L7:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
popl %ebp
ret
Well, that's what happens when one post some code after some heavy
coding all day long, and when one tries to answer two questions at the
same time....That's why I would have prefered to find the relevant
part instead in the C++FAQ :)
Anyway, for the question "is there bound checking with operator[]",
the answer of Bjarne Stroustrup is no :).
The other problem "is [] as efficient for vector and plain c array
?", well, people who know better than me asm/gcc can test and answer.
Yeah, it really needs to be tested to tell. I remember taking a course in
VAX Macro asm back in the days of dinosaur eggs and phonograph needles. The
book, DEC, and the teacher all said you could turn off the VAX debugging mode
when you compiled. I wrote some self-modifying code for one of the exercises (I
wouldn't do that in real life ;-) The compiler still slapped in some debugging
stuff and it wouldn't work. It was a real simple program though so the
instructor checked it and passed it anyway ;-)
Jan