KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a class declared in the following way: #ifndef MYCLASS_H #define MYCLASS_H class MyClass : public MyOtherClass { public: MyClass(); int a() const{ return _a; }; int b() const{ return _b; }; private: int _a; int _b; }; inline bool operator==( const MyClass& lhs, const MyClass& rhs ) { return (lhs.a() == rhs.a()) && (lhs.b() == rhs.b()); } #endif My problem is that any breakpoints is set in the overloaded operator== never get hit, with Visual Studio even telling me that execution will never reach this function. I've followed this rule of thumb for overloading comparison operators, but it doesn't mention anything other than to make them non-members, so I'm not sure if I've missed something with operator overloading or inline functions. Can anyone tell me why my breakpoints are never being hit?
Tags (comma-separated)
Save Edits
Cancel