I have a class Bill, and I wrote this functor in this class
//functor
bool operator==(const Bill& other) const;
void operator()(int x) { sumCost -= x; }
What I don't know, is how to use it in main
.
Thanks for help!
I have a class Bill, and I wrote this functor in this class
//functor
bool operator==(const Bill& other) const;
void operator()(int x) { sumCost -= x; }
What I don't know, is how to use it in main
.
Thanks for help!
Use it in the main will be the same as use in any other function:
int main()
{
Bill b;
b( 123 );
return 0;
}