c++ - Calling overloaded operator () from object pointer -
consider following:
class myclass { public: int operator ()(int a, int b); }; when have:
myclass* m = new myclass(); i want access operator() method, could:
(*m)(1,2); but can this?
m->(1,2);
not syntax, can do
m->operator()(1,2);
Comments
Post a Comment