[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed
From: |
al davis |
Subject: |
Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed |
Date: |
Fri, 12 May 2006 18:55:56 -0400 |
User-agent: |
KMail/1.9.1 |
On Friday 12 May 2006 18:24, Ilia Mirkin wrote:
> Also, when you do
>
> vector<int> x;
> x[0] = 5;
>
> keep in mind that internally it instantiates a new int
> object, and then calls operator= on it. The compiler might
> optimize this to a certain extent, but certainly not to the
> level of simplicity of a single memory access/write.
A good compiler will optimize it that well.
Your code is wrong. The vector x is of size zero. It should
crash.
You need:
vector<int> x;
x.reserve(5);
x[0] = 5;
or:
vector<int> x(5);
x[0] = 5;
- [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Message not available
- Message not available
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Ilia Mirkin, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Ilia Mirkin, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed,
al davis <=
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Ilia Mirkin, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, John Aldridge, 2006/05/13
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Eric Blossom, 2006/05/13
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/14
- Message not available
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/14
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Eric Blossom, 2006/05/14
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Eric Blossom, 2006/05/14
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Dave Dodge, 2006/05/15
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, al davis, 2006/05/12