On Sat, 19 Mar 2011 11:18:17 +0100, Jonathan M Davis <jmdavisp...@gmx.com> wrote:

There are times when I've wanted something like this because I don't
know the resultant type of a bunch of range operations, but have to
save it in a struct or class.

typeof is your friend.

Only when there is a definite type. Consider:

struct foo {
    Range!int rng;

    this( int[] arr, bool b ) {
        if ( b ) {
            rng = arr;
        } else {
            rng = map!"a+b"( arr );
        }
    }
}


--
Simen

Reply via email to