[Vala] int64 generics




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all:

I need to create an ArrayList with int64 values. Using

    var mylist = new ArrayList<int64>();

returns an error: int64 is not a supported generic type argument, use
? to box value types

I box it with

    var mylist = new ArrayList<int64?>();

and compiles, but the sort() function works incorrectly. I created my
own compare function, but the results are exactly the same.

    public static int mysort(int64? a, int64? b) {
        if(a>=b) {
            return 1;
        } else {
            return 0;
        }
    }

(I tested both with int64 and int64? in the params, but is the same).

How can I do it?

Thanks.

- -- 
Nos leemos
                 RASTER    (Linux user #228804)
raster rastersoft com              http://www.rastersoft.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk44hv8ACgkQXEZvyfy1ha9zCACbBHxxZKJWb9GqLRPl9e7PWr/q
KOMAoJujz8PSjiHtldBDMLRH/RTFfktZ
=6maQ
-----END PGP SIGNATURE-----




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]