Syntax Trouble

Hello everyone!

I am having a bit trouble understanding what the following line does:

 
virtual int operator()(Key & k) = 0;


where this declaration comes as a public member of a hash function class.



Last edited on
It's a pure virtual function, see http://www.cplusplus.com/doc/tutorial/polymorphism/
Aah, pure virtual function, abstract base classes, okay...
Last edited on
That's just how you declare a virtual function. It has to do with setting the vtable function pointer to null, I believe.
This is one of the most bizarre things in c++, but it's the best they can do, because c++ has a huge amount of grammar.
Besides being a pure virtual function, it is also a function call operator overload.
Topic archived. No new replies allowed.