Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-25 Thread Michael.Gogins
I did test it, and it was just as fast either way (g++ 3.3/MSVC++ 7.0 on Windows 2000 a year or so ago). Regards, MIke

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Chris Cannam
On Thursday 09 Jun 2005 23:16, fons adriaensen wrote: > > int access(int *v, int i) > { > return v[i]; > } Of course, passing that pointer by value is horribly inefficient. int access(int *const &v, int i) { return v[i]; } Chris

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread fons adriaensen
On Thu, Jun 09, 2005 at 09:39:21PM +0300, Jussi Laako wrote: > > int access(std::vector v, int i) > > { > > return v[i]; > > } > > At least you are making copy here, should be > > int access(std::vector &v, int i) No such problem with int access(int *v, int i) { return v[i]; } :-) :-)

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread stefan kersten
On Thu, Jun 09, 2005 at 08:23:57PM +0100, Chris Cannam wrote: > On Thursday 09 Jun 2005 20:07, stefan kersten wrote: > > On Thu, Jun 09, 2005 at 09:39:21PM +0300, Jussi Laako wrote: > > > On Thu, 2005-06-09 at 18:14 +0200, stefan kersten wrote: > > > > int access(std::vector v, int i) > > > > > > A

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Paul Davis
>a: a.cpp:5: A::A(const A&): Assertion `0' failed. as an uncle of mine liked to quote "subtle as a flying mallet" :))

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Chris Cannam
On Thursday 09 Jun 2005 20:07, stefan kersten wrote: > On Thu, Jun 09, 2005 at 09:39:21PM +0300, Jussi Laako wrote: > > On Thu, 2005-06-09 at 18:14 +0200, stefan kersten wrote: > > > int access(std::vector v, int i) > > > > At least you are making copy here, should be > > int access(std::vector &v,

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread stefan kersten
On Thu, Jun 09, 2005 at 09:39:21PM +0300, Jussi Laako wrote: > On Thu, 2005-06-09 at 18:14 +0200, stefan kersten wrote: > > > int access(std::vector v, int i) > > { > > return v[i]; > > } > > At least you are making copy here, should be > > int access(std::vector &v, int i) actually not, s

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Paul Davis
>#include > >int access(int* v, int i) >{=20 >return v[i]; >}=20 > >int access(std::vector v, int i) ahem. pass by reference vs. pass by value?

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Jussi Laako
On Thu, 2005-06-09 at 18:14 +0200, stefan kersten wrote: > int access(std::vector v, int i) > { > return v[i]; > } At least you are making copy here, should be int access(std::vector &v, int i) -- Jussi Laako <[EMAIL PROTECTED]>

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread stefan kersten
On Thu, Jun 09, 2005 at 11:41:00PM +0900, David Cournapeau wrote: > The other problem "is [] as efficient for vector and plain > c array ?" possibly maybe: #include int access(int* v, int i) { return v[i]; } int access(std::vector v, int i) { return v[i]; } produces (g++ -fv

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread eviltwin69
On Thu, 9 Jun 2005 23:41 , David Cournapeau <[EMAIL PROTECTED]> sent: >On 6/9/05, stefan kersten [EMAIL PROTECTED]> wrote: >> On Thu, Jun 09, 2005 at 10:31:35PM +0900, David Cournapeau wrote: >> > _Z6vectorSt6vectorIiSaIiEE: >> > .LFB539: >> > .L2: >> > .L7: >> > pushl %ebp >> > .LCFI0:

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread David Cournapeau
On 6/9/05, stefan kersten <[EMAIL PROTECTED]> 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 >

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread stefan kersten
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 you've been bitten by the optimizer, this function does nothing but return (

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread David Cournapeau
> No, I am not. I cannot find the information on the C++ faq right now, > but If m pretty sure that it is written in the book of Stroustrup. > Of course, once I press the send button, I find the relevant webpage: http://www.research.att.com/~bs/3rd_tour2.pdf (page 9 of the pdf) "3.7.2 Range Che

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread David Cournapeau
On 6/9/05, Erik de Castro Lopo <[EMAIL PROTECTED]> wrote: > David Cournapeau wrote: > > > [EMAIL PROTECTED] wrote: > > > > > > > >I was under the impression that there was bounds checking going on with > > >vectors. Is this not the case? > > > > > > > > > > > Not necesserally: if you are usin

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Erik de Castro Lopo
David Cournapeau wrote: > [EMAIL PROTECTED] wrote: > > > > >I was under the impression that there was bounds checking going on with > >vectors. Is this not the case? > > > > > > > Not necesserally: if you are using operator (), yes, if you use operator > [], no. I think you are all guess

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Arnold Krille
On Thursday 09 June 2005 12:46, Chris Cannam wrote: > Jan Depner: > > I was under the impression that there was bounds checking going on with > > vectors. Is this not the case? > Nope. As far as I know the [] is not checked. but at() is... Arnold -- There is a theory which states that if ever

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread David Cournapeau
David Cournapeau wrote: [EMAIL PROTECTED] wrote: I was under the impression that there was bounds checking going on with vectors. Is this not the case? Not necesserally: if you are using operator (), yes, if you use operator [], no. David Sorry, you should read "vec.at(index) d

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread David Cournapeau
[EMAIL PROTECTED] wrote: I was under the impression that there was bounds checking going on with vectors. Is this not the case? Not necesserally: if you are using operator (), yes, if you use operator [], no. David

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Chris Cannam
Jan Depner: > I was under the impression that there was bounds checking going on with > vectors. Is this not the case? Nope. Chris

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread eviltwin69
On Thu, 9 Jun 2005 10:05 , 'Chris Cannam' <[EMAIL PROTECTED]> sent: >N Smethurst: >> Since a vector is a wrapped C array (i.e. contigous), the [] operator >> compiles to the C equivalent when optimisation is turned on. > >I was thinking of iterator operations, having vaguely recalled that the v

Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time toomany

2005-06-09 Thread Chris Cannam
N Smethurst: > Since a vector is a wrapped C array (i.e. contigous), the [] operator > compiles to the C equivalent when optimisation is turned on. I was thinking of iterator operations, having vaguely recalled that the vector iterator in the gcc library had at some point changed from an actual