DMD64 D Compiler v2.066.1
Why second call doesn't compile?
import std.array;
import std.algorithm;
class Foo {
bool flag;
}
void main() {
immutable(Foo)[] foos;
foreach(i; 0..5) foos ~= new Foo;
// compiles, typeof(bar1) == immutable(Foo)[]
auto bar1 =
On Fri, 07 Nov 2014 14:32:57 +
Jack Applegame via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
ah, sorry, my bad, 'const' will not work to, for the same reason.
signature.asc
Description: PGP signature
On Fri, 07 Nov 2014 14:32:57 +
Jack Applegame via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
import std.array;
import std.algorithm;
class Foo {
bool flag;
}
void main() {
immutable(Foo)[] foos;
foreach(i; 0..5) foos ~= new Foo;
// compiles,
On Friday, 7 November 2014 at 14:57:56 UTC, ketmar via
Digitalmars-d-learn wrote:
`map` cannot return range with immutable elements, 'cause they
are
obviously generated by program, and therefore aren't
immutable.
That's not true. Runtime generated values can be immutable just
fine. And it's
On Fri, 07 Nov 2014 15:18:24 +
anonymous via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Friday, 7 November 2014 at 14:57:56 UTC, ketmar via
Digitalmars-d-learn wrote:
`map` cannot return range with immutable elements, 'cause they
are
obviously generated by
On Friday, 7 November 2014 at 14:33:00 UTC, Jack Applegame wrote:
DMD64 D Compiler v2.066.1
Why second call doesn't compile?
import std.array;
import std.algorithm;
class Foo {
bool flag;
}
void main() {
immutable(Foo)[] foos;
foreach(i; 0..5) foos ~= new Foo;
//