Skip to content
MapInitWithValueCompare

MapInitWithValueCompare

Description

Initialize a map with key/value comparators.

Usage example (Cross-references)

Usage examples (Cross-references)
        typedef Map(int, int) IntIntMap;
        DefaultAllocator alloc = DefaultAllocatorInit();
        IntIntMap        map   = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
    
        MapInsertR(&map, 1, 10);
        typedef Map(int, int) IntIntMap;
        DefaultAllocator alloc = DefaultAllocatorInit();
        IntIntMap        map   = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
    
        MapInsertR(&map, 5, 50);
        typedef Map(int, int) IntIntMap;
        DefaultAllocator alloc = DefaultAllocatorInit();
        IntIntMap        map   = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
    
        MapSetOnlyR(&map, 7, 70);
        typedef Map(int, int) IntIntMap;
        DefaultAllocator alloc  = DefaultAllocatorInit();
        IntIntMap        first  = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
        IntIntMap        second = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
        DefaultAllocator alloc  = DefaultAllocatorInit();
        IntIntMap        first  = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
        IntIntMap        second = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
    
        MapInsertR(&first, 1, 10);
        typedef Map(int, int) IntIntMap;
        DefaultAllocator alloc = DefaultAllocatorInit();
        IntIntMap        map   = MapInitWithValueCompare(i32_hash, i32_compare, i32_compare, &alloc);
    
        bool result =
Last updated on