[Vala] Does Vala.HashMap works ?



this code is almost the same with the  libgee example.
but the value haspmap will always be 0 for int , (null) for string.

--------------------------------------------------------------------------------------------------------------
using Vala;
static int main (string[] args) {

    var map = new Vala.HashMap<string, int> ();
    map.set ("one", 1);
    map.set ("two", 2);
    map.set ("three", 3);
    map["four"] = 4;            // same as map.set ("four", 4)
    map["five"] = 5;
//  foreach (string key in map.keys) {
        stdout.printf ("%d\n", map["two"]);       // same as map.get (key)
//  }

    return 0;
}
--------------------------------------------------------------------------------------------------------------



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