I was wondering about it for some time:
void foreach_loop(int arr[100])
{
foreach(i,a; arr)
{
auto e = a;
}
}
void for_loop(int arr[100])
{
for (int i = 0; i < 100; ++i)
{
auto e = arr[i];
}
}
compiled with -O -release yields this:
.text.void main.forea
Dnia 08-09-2010 o 23:12:55 Stanislav Blinov
napisał(a):
I was wondering about it for some time:
void foreach_loop(int arr[100])
{
foreach(i,a; arr)
{
auto e = a;
}
}
void for_loop(int arr[100])
{
for (int i = 0; i < 100; ++i)
{
auto e = arr[i];
On 9/09/2010 6:56 AM, Tomek Sowiński wrote:
Without -O -release the difference is even greater
Is this normal? I mean, shouldn't the compiler optimize foreach a bit
more? Or is it that I simply misunderstand generated code?
Yes, it should; that was the point of having foreach in the language:
Justin Johansson Wrote:
> Is there a roadmap for what things are more urgent? The OP has a
> valid point in asking what is the point of the language. A decent
> roadmap would help newcomers and oldcomers alike to stay with the
> Holy Grail of D.
>
> Justin
There is a somewhat official road map
Are the ones listed under "Known D2" official?
There's "Remove C-style declarations." Is this really scheduled for removal?
On Thu, Sep 9, 2010 at 8:33 PM, Jesse PHillips
wrote:
> Justin Johansson Wrote:
>
>> Is there a roadmap for what things are more urgent? The OP has a
>> valid point in ask
Tomek Sowiński wrote:
Dnia 08-09-2010 o 23:12:55 Stanislav Blinov
napisał(a):
I was wondering about it for some time:
void foreach_loop(int arr[100])
{
foreach(i,a; arr)
{
auto e = a;
}
}
void for_loop(int arr[100])
{
for (int i = 0; i < 100; ++i)
{
Justin Johansson wrote:
On 9/09/2010 6:56 AM, Tomek Sowiński wrote:
Without -O -release the difference is even greater
Is this normal? I mean, shouldn't the compiler optimize foreach a bit
more? Or is it that I simply misunderstand generated code?
Yes, it should; that was the point of having
On Thursday, September 09, 2010 13:31:13 Stanislav Blinov wrote:
> Justin Johansson wrote:
> > On 9/09/2010 6:56 AM, Tomek Sowiński wrote:
> >>> Without -O -release the difference is even greater
> >>>
> >>> Is this normal? I mean, shouldn't the compiler optimize foreach a bit
> >>> more? Or is it