#include <iostream>
using namespace std;

template <typename T>
bool less(const T &ref1, const T &ref2) {
  return ref1<ref2;
}

int main()
{
  cout << less<char>('A', 'B') <<endl;
}

これをg++でコンパイルすると、less undeclared (first use this function)
とエラーになってしまいます。どこがいけないんでしょうか?