in VS2017 i get error C2660. There are many posts related to this, but i found no case comparable with mine.
Situation: Class A implements getter/setter for _mem. The setter is virtual and overwritten in B. In B function "set" i call the getter, which is only declared in A and is void. So a pretty unique thing. Why even though getting c2660? I dont see it, sorry for that.
(Want only setter - which expects a param value - overwrite and keeping getter which does not take any parameters.)
class A
{
public:
A(int x)
{
_mem=x;
}
inline int mem(void) const {return _mem;}
virtual bool mem (int x) { _mem=x; return true;}
protected:
int _mem;
};
class B : public A
{
public:
B (int x) : A(x)
{
}
public:
bool mem (int x) { _mem = x;return true; }
void set(const B& x)
{
x.mem(); // c2660
}
};