#include <vector>
#include <unordered_set>
#include <functional>
struct Point
{
float x;
float y;
Point() : x(0), y(0) {}
};
int main()
{
auto hash=[](const Point& pt){
return (size_t)(pt.x*100 + pt.y);
};
auto hashFunc=[&hash](){
return std::function<size_t(const Point&)> (hash);
};
auto equal=[](const Point& pt1, const Point& pt2){
return ((pt1.x == pt2.x) && (pt1.y == pt2.y));
};
auto equalFunc=[&equal](){
return std::function<size_t(const Point&,const Point&)> (equal);
};
using PointHash=std::unordered_set<Point,decltype(hashFunc),decltype(equalFunc)>;
//equalKey()(Point(),Point());//ok
PointHash Test(10,hashFunc,equalFunc);
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHVub3JkZXJlZF9zZXQ+CiNpbmNsdWRlIDxmdW5jdGlvbmFsPgoKc3RydWN0IFBvaW50CnsKICAgIGZsb2F0IHg7CiAgICBmbG9hdCB5OwogICAgUG9pbnQoKSA6IHgoMCksIHkoMCkge30KfTsKCmludCBtYWluKCkKewogICAgYXV0byBoYXNoPVtdKGNvbnN0IFBvaW50JiBwdCl7CiAgICAgICAgcmV0dXJuIChzaXplX3QpKHB0LngqMTAwICsgcHQueSk7CiAgICB9OwogICAgYXV0byBoYXNoRnVuYz1bJmhhc2hdKCl7CiAgICAgICAgcmV0dXJuICBzdGQ6OmZ1bmN0aW9uPHNpemVfdChjb25zdCBQb2ludCYpPiAoaGFzaCk7CiAgICB9OwogICAgYXV0byBlcXVhbD1bXShjb25zdCBQb2ludCYgcHQxLCBjb25zdCBQb2ludCYgcHQyKXsKICAgICAgICByZXR1cm4gKChwdDEueCA9PSBwdDIueCkgJiYgKHB0MS55ID09IHB0Mi55KSk7CiAgICB9OwogICAgYXV0byBlcXVhbEZ1bmM9WyZlcXVhbF0oKXsKICAgICAgICByZXR1cm4gc3RkOjpmdW5jdGlvbjxzaXplX3QoY29uc3QgUG9pbnQmLGNvbnN0IFBvaW50Jik+IChlcXVhbCk7CiAgICB9OwogICAgdXNpbmcgUG9pbnRIYXNoPXN0ZDo6dW5vcmRlcmVkX3NldDxQb2ludCxkZWNsdHlwZShoYXNoRnVuYyksZGVjbHR5cGUoZXF1YWxGdW5jKT47Ci8vZXF1YWxLZXkoKShQb2ludCgpLFBvaW50KCkpOy8vb2sKICAgIFBvaW50SGFzaCBUZXN0KDEwLGhhc2hGdW5jLGVxdWFsRnVuYyk7CgogICAgcmV0dXJuIDA7Cn0K