[Vala] HashTable foreach



Hi,

valac accepts foreach -construct for HashTable but does not seem to
generate any code for it?

"""
using GLib;

public class TestHashTableForeach {

    public static int main(string[] args) {
        HashTable<string,string> ht = new HashTable(str_hash,str_equal);
        ht.insert("test","test");
        foreach(string s in ht) {
            stdout.printf("Key? %s\n",s);
        }
        return 0;
    }
}
"""

Regards,
        Hessu




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