template<class Key, class Value>
AVLTree<Key,Value>::AVLTree(){
this->lessThan = Key::operator<;
}
This code is supposed to make the std::function<bool(Key, Key)> lessThan
field equal to the key's < operator by default. However, when I try this with AVLTree<int,int>
, I get:
error: ‘operator<’ is not a member of ‘int’
Am I formatting this wrong, or is this just impossible in C++?