www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Is there any way to have [] overloads use compile-time indexes as is

reply pineapple <meapineapple gmail.com> writes:
I'd really like to define my own types that accept indexes for 
opIndex and opSlice as template arguments. Is there any way to do 
this? If not, this seems like an obvious thing to add to the 
language - what's been holding it back?
Sep 27 2016
parent Basile B. <b2.temp gmx.com> writes:
On Tuesday, 27 September 2016 at 09:21:04 UTC, pineapple wrote:
 I'd really like to define my own types that accept indexes for 
 opIndex and opSlice as template arguments. Is there any way to 
 do this? If not, this seems like an obvious thing to add to the 
 language - what's been holding it back?
https://issues.dlang.org/show_bug.cgi?id=16302
Sep 27 2016