fork download
  1. template <typename T>
  2. struct Comparator : public std::binary_function<T,T,bool>
  3. {
  4. bool operator()(const T &first, const T &second)
  5. {
  6. return first < second;
  7. }
  8. };
  9. template <typename T>
  10. bool compare(T &, T &) = &Comparator::operator();
  11.  
  12. // 10: error: C2955: 'Comparator': use of class template requires template argument list
  13. // 10: error: C2059: syntax error: '&'
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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();
                           ^
stdout
Standard output is empty