puzzlecracker wrote:
I have never seen this in practice and interested in its pros, or ever
existential (another words, standardized) possibility?
I see nothing special in a member operator versus any other non-static
member function. Yes, absolutely, they can be virtual and it does make
sense to make them virtual if you need polymorphic behaviour.
Operators are nothing but syntactic sugar. Instead of, say, a function
...
virtual void doSomethingWith(int);
...
you could write
...
virtual void operator+(int);
...
.. And later, instead of writing
myobjectRef.doSomethingWith(42);
you would write
myojbectRef + 42;
Now, whether this makes sense is entirely problem-specific and cannot
be judged without any regard to what the purpose of the code is.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask