I have a wrapper class for an object. I want it to apply all operations applied to it on the wrapped object, e.g wrapper+=a
would yield the same result as wrapped+=a
, for instance. I want to apply this for all operators. Any simple way to override all operators without overriding each one explicitly?
views:
96answers:
2
+1
A:
No, sorry. Though you could write an interface (probably as a decorator or base class) that makes this easy, if you need to do it more than once. Or use one provided already. (Guess I was 40s too late.)
Roger Pate
2010-02-03 21:32:50