UnKnown Nick wrote: | [...] and wanted to avoid these warning as well. Any help on it
|
|
You will avoid those warnings by providing some useful implementation for the operators you overload, such as:
class Foo { public: const Foo& operator()(const Foo& rhs) { // x = rhs.x; <- uncomment to remove the warning return *this; } private: int x; }
Alternatively, you should also be able to disable the warning by using a pragma:
class Foo { public: // save current warning scheme #pragma warning(push) // ignore empty operator warning #pragma warning(disable: 4552) const Foo& operator()(const Foo& rhs) { return *this; } // restore saved warning scheme #pragma warning(pop) private: int x; }
|