Re: [Vala] Libgee problem



Hi,

2009/12/9 Nicolas <c r n a wanadoo fr>:
Hello,

I need to use libgee with double.

The problem is, :
var map = new HashMap <double, double> ();

Return this error:
error: `double' is not a supported generic type argument, use `?' to box
value types

Why libgee does not support double with hashmap?
Because vala doesn't support double in generics (the error you got).
Not sure if it would help, but did you try its suggestion to use
'double?' instead?

This is an implementation detail but int is easier because of
G_[U]INT_{TO,FROM}_POINTER which can be used to convert from int to
pointer and back. (and no such thing exist for floats).

anyway, since double is a value type, double? it may work.

HTH,
Abderrahim



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