Top 5

Max Samukha samukha at voliacable.com.removethis
Tue Oct 28 11:12:03 PDT 2008


On Tue, 28 Oct 2008 13:04:51 -0400, bearophile
<bearophileHUGS at lycos.com> wrote:

>Max Samukha:
>>     alias Tuple!(1, int, "string") t;
>>     const l = t.length; // have to use temporary because of a bug
>>     foreach (i; Range!(l)) {
>>         static if (is(t[i]))
>
>This may be enough (not tested):
>
>foreach (el; Tuple!(1, int, "string")) {
>    static if (is(el))
>
>Bye,
>bearophile

Sadly, no. It doesn't like the int and type of el is always type of
first element.



More information about the Digitalmars-d mailing list