Why does std::less<Eigen::VectorXd> fail to compile?
问题 I implemented a comparison operator operator< for Eigen::VectorXd , and sometimes, I need to pass a compare function to another of my function, I am tired of wrapping the operator< into [](const VectorXd& v1, const VectorXd& v2)->bool{return v1 < v2} , so I think the std::less class would be useful, as, to my understanding, it can generate the lambda function as long as operator< is defined. However, I found that std::less<VectorXd> didn't work for me, for example, the below code works fine: