http://d.puremagic.com/issues/show_bug.cgi?id=8297
Summary: Cannot access front of array with immutable elements
Product: D
Version: D2
Platform: x86_64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Roman D. Boiko <[email protected]> 2012-06-25 09:04:47 PDT
---
import std.range;
struct Element {
//immutable // uncomment to break compilation
int _i;
this(int i) { _i = i; }
}
void main() {
auto arr = [Element.init];
arr.front;
}
Declaring _i as immutable yields the following compilation error:
/usr/include/x86_64-linux-gnu/dmd/phobos/std/array.d(460): Error:
a[0LU] isn't mutable
sample.d(11): Error: template instance std.array.front!(Element)
error instantiating
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------