hi,
this code compiled using visual studio. Have changed the line
const size_t i= __gnu_cxx::hash(x);
from
const size_t i=stdext::hash_value(x);
so that it would compile using gcc. However I am getting an error message as shown below.
Any suggestions appreciated. Thx
template<class X, class Pred= less<X> >
class Hash{
private:
Pred comp;
public:
enum{bucket_size = 4, min_buckets = 8};
Hash() : comp(){ }
Hash(Pred p) : comp(p){ }
size_t operator()(const X& x) const{
const size_t i= __gnu_cxx::hash(x);
return 16807U*(i%127773U)+(95329304U-2836U*(i/127773U));
}
};
error: expected initializer before __gnu_cxx