The code below don’t compile in vs 2012. In line 4 I got an error C2143: syntax error : missing ‘,’ before ‘<‘. Can somebody help me to fix it. I would be very appreciate.
ps. dont’ focus on case insensitive, i have delete something to make the code simpler.
#include<functional>
template<typename Ty>
struct case_insensitive_less : public binary_function<Ty, Ty, bool>{
bool operator()(Ty const& left, Ty const& right) const
{
return (left < right);
}
};
int main(){}
You need the
stdnamespace:Note that std::binary_function is deprecated in C++11. If you have C++11 support, consider using std::function and/or lambdas.