source: trunk/symtab/hash_test.cpp @ 2152

Last change on this file since 2152 was 1929, checked in by ksherdy, 8 years ago

Updated identity symbol table.

File size: 743 bytes
Line 
1/*
2 * Created on: 18-December-2011
3 * Author: Ken Herdy
4 *
5 * Quick and dirty.
6 *
7 */
8#include "hash_table.hpp"
9#include <iostream>
10using namespace std;
11
12int main() {
13
14    cout << "Hash Table" << endl;
15
16    //hash_table<identity_strategy<1>, fast_pool_allocator<1024> > h1;
17    //h1.print_table();
18
19    identity_compare k;
20    identity_compare_t<uint32_t,4> k_t;
21
22    string X("abcd");
23    string Y("abce");
24
25    uint32_t * x = (uint32_t *)X.c_str();
26    uint32_t * y = (uint32_t *)Y.c_str();
27
28    //cout << k.compare((uint8_t*)key.c_str(),(uint8_t*)value.c_str(),4) << endl;
29    cout << k_t.compare(x,x,4) << endl;
30    cout << k_t.compare(x,y,4) << endl;
31    cout << k_t.compare(y,y,4) << endl;
32
33    cout << "Done." << endl;
34
35    return 0;
36}
Note: See TracBrowser for help on using the repository browser.