https://d.puremagic.com/issues/show_bug.cgi?id=11877
Summary: static opSlice is not possible
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Dicebot <[email protected]> 2014-01-07 05:01:05 PST ---
struct X
{
static int opSlice(size_t a, size_t b)
{
return 42;
}
}
static assert ( X[1..2] == 42 );
// Error: cannot slice type 'X'
-------------------------------------------
There is not reason why slicing should be prohibited in this case. It conforms
usual operator syntax rewrite rules and has no grammar ambiguity with array
types if slicing bounds are used.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------