Re: Is there any way to have [] overloads use compile-time indexes as is currently done for Tuples?

2016-09-27 Thread Basile B. via Digitalmars-d-learn

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


Is there any way to have [] overloads use compile-time indexes as is currently done for Tuples?

2016-09-27 Thread pineapple via Digitalmars-d-learn
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?