I'm wondering if the following can be done in C++.
What I want to do is have a group of classes which all have the same public parts -- that is, the same public variables, and the same set of methods -- however, different classes within this group of classes would differ in the private parts -- that is, they could have different private variables -- and though the set of methods would be uniform for all classes of such a group, the implementations of these methods could vary.
And there's the one extra bit -- which I wonder if C++ supports -- I would like it to be so that all objects which belong to classes within this group be effectively the same datatype. That is, any part of the program outside the internals of the class will make no distinction between objects of one class and objects of the other class -- provided that both classes are part of this same group.
A function that takes as an argument one class of this class-group would be able to take as that argument any class of this class-group. A variable that references an object of one class of this class-group could reference an object of any class of this class-group.
Why do I want to know if this can be done? Because if it can be, I could use such a group of classes as an abstraction layer.