
Hi, A newbie question regarding functional/hash. I would like to use TR1 unordered_map for a 2D point custom data type. For this, I use hash_value from Boost. But I would like to give/pass a context to this function : here, width & height of domain in which are my 2D points. Currently, I declare theses width and height static. My code (in my cpp file) looks like : static int P_width; static int P_height; std::size_t hash_value(point const& p) { return ((size_t)p.x()<<1)*P_width + (size_t)(p.y()<<1); } But this solution is not satisfactory as I can not have several instances of my class including the unordered_map, i.e., several domains of different width & height. Is there a straightforward solution that I have overlooked ? Regards, Boris.