[Issue 2628] obj[n] not allowed for user-defined tuples

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 28 00:25:11 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2628





------- Comment #1 from samukha at voliacable.com  2009-01-28 02:25 -------
> struct Tuple(T...)
> {
>    private T field;
>    ref T[i] opIndex(size_t i) { return field[i]; }
> }

That won't work as the return type of the function would depend on the function
argument. At least until the requirement for CTFE functions to be evaluatable
both at compile time and at run time is abolished.


-- 



More information about the Digitalmars-d-bugs mailing list