M
Matt
Does C++ provide a means to use a conversion operator as a lval?
ie, I want:
class superInt
{
public:
operator int() { return this->value; }
private:
int value;
};
....to instead be this:
class superInt
{
public:
int& operator int() { return this->value; }
private:
int value;
};
....which will not compile.
I suspect the C++ language designers avoided this on purpose, but I
thought I would ask here just in case there is a means to do this (in
some other way then I present above).
Such a thing would save me time re-writing a bunch of overloaded
operators for superInt (among other things).
-Matt
ie, I want:
class superInt
{
public:
operator int() { return this->value; }
private:
int value;
};
....to instead be this:
class superInt
{
public:
int& operator int() { return this->value; }
private:
int value;
};
....which will not compile.
I suspect the C++ language designers avoided this on purpose, but I
thought I would ask here just in case there is a means to do this (in
some other way then I present above).
Such a thing would save me time re-writing a bunch of overloaded
operators for superInt (among other things).
-Matt