D - lvalue to slice
- Vathix (11/11) Mar 19 2004 Provided:
Provided: int i; How about &i implicitly converts to type int[0 .. 1] ? You could do this: char[] foo(char ch) { return "The character is: " ~ &ch; //instead of (&ch)[0 .. 1] } The compiler already knows how many elements it has, so why not? :) -- Christopher E. Miller
Mar 19 2004