L
Lilith
Sorry if the subject line is vague.
I *think* I've seen discussion in the past of this capability but I'm
unable to find it. Essentially I have a context in which at makes
sense to have a class object return an integer value when the object's
name is used.
class X {
int XNumber;
};
..
..
X a;
X b;
..
..
xxxCopy (a, b);
xxxCopy() is unrelated to class X and works on integer values that are
stored within its own system. My class has to store the number used
by the system that uses xxxCopy(). I know I could provide a member
function of X to return the value but using the name of the object and
not a method within it is more instinctive for my uses.
I think I've read that it's possible to over load an operator to
provide this functionality but at the time it was of interest but no
immediate need. Then again, I may have just had a dream about it.
I *think* I've seen discussion in the past of this capability but I'm
unable to find it. Essentially I have a context in which at makes
sense to have a class object return an integer value when the object's
name is used.
class X {
int XNumber;
};
..
..
X a;
X b;
..
..
xxxCopy (a, b);
xxxCopy() is unrelated to class X and works on integer values that are
stored within its own system. My class has to store the number used
by the system that uses xxxCopy(). I know I could provide a member
function of X to return the value but using the name of the object and
not a method within it is more instinctive for my uses.
I think I've read that it's possible to over load an operator to
provide this functionality but at the time it was of interest but no
immediate need. Then again, I may have just had a dream about it.