/*Orion Lawlor's Simple C++ Examples, olawlor@acm.org
Shows how to overload a class foo's
function call operator (parenthesis).
*/
#include <iostream>

class foo {
private:
	double myVal;
public:
	double &operator()(int i,int j) {
		std::cout<<"Called foo's operator() with "
			<<i<<","<<j<<std::endl;
		return myVal;
	}
};

int main()
{
	foo f;
	f(3,4)=2.8;
	double x=f(7,12);
	return 0;
}
/*<@>
<@> ******** Program output: ********
<@> Called foo's operator() with 3,4
<@> Called foo's operator() with 7,12
<@> */
