Is there a way to write an equality test for a VBA class with private members without exposing knowledge of the existence of those private members?
问题 I do a fair amount of Excel VBA programming, but not a lot of it is object-oriented. Here is something that comes up every now and then that bugs me, and I'm wondering if there's something I'm missing. In VBA, say I have a class C defined with some private members like so: '... Private hidden1_ As Double Private hidden2_ As Double '... If VBA worked like C++ or (most?) other languages that support OOP, I could write a member function to do an equality test between instances of class C like