template <typename T>
struct Comparator : public std::binary_function<T,T,bool>
{
bool operator()(const T &first, const T &second)
{
return first < second;
}
};
template <typename T>
bool compare(T &, T &) = &Comparator::operator();
// 10: error: C2955: 'Comparator': use of class template requires template argument list
// 10: error: C2059: syntax error: '&'
dGVtcGxhdGUgPHR5cGVuYW1lIFQ+CnN0cnVjdCBDb21wYXJhdG9yIDogcHVibGljIHN0ZDo6YmluYXJ5X2Z1bmN0aW9uPFQsVCxib29sPgp7CiAgICBib29sIG9wZXJhdG9yKCkoY29uc3QgVCAmZmlyc3QsIGNvbnN0IFQgJnNlY29uZCkKICAgIHsKICAgICAgICByZXR1cm4gZmlyc3QgPCBzZWNvbmQ7CiAgICB9Cn07CnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpib29sIGNvbXBhcmUoVCAmLCBUICYpID0gJkNvbXBhcmF0b3I6Om9wZXJhdG9yKCk7CgovLyAxMDogZXJyb3I6IEMyOTU1OiAnQ29tcGFyYXRvcic6IHVzZSBvZiBjbGFzcyB0ZW1wbGF0ZSByZXF1aXJlcyB0ZW1wbGF0ZSBhcmd1bWVudCBsaXN0Ci8vIDEwOiBlcnJvcjogQzIwNTk6IHN5bnRheCBlcnJvcjogJyYn
prog.cpp:2:48: error: expected template-name before '<' token
struct Comparator : public std::binary_function<T,T,bool>
^
prog.cpp:2:48: error: expected '{' before '<' token
prog.cpp:2:48: error: expected unqualified-id before '<' token
prog.cpp:10:27: error: invalid pure specifier (only '= 0' is allowed) before 'Comparator'
bool compare(T &, T &) = &Comparator::operator();
^