I was wondering how you can do polymorphism with references, as opposed to pointers.
To clarify, see the following minimal example:
cl
This is indeed a bit odd. If you want a member-variable of type A1 (rather than a reference), why not just rearrange your code so that the definition of A1 appears before the definition of B?
A1
B