http://d.puremagic.com/issues/show_bug.cgi?id=10266
Summary: CTFE: Allow reinterpret casts T <-> T[1]
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: CTFE
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Denis Shelomovskij <[email protected]> 2013-06-04
19:54:43 MSD ---
This is necessary if you don't want to branch a templated function in static
array case and just treat everything as a flat static array (i.e. both T and
T[1][1] become T[1]):
---
ref f(ref int i)
{
return *cast(int[1]*) &i;
}
void g()
{
int i;
f(i)[0] = 5;
assert(i == 5);
}
static assert((g(), true));
---
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------