In C++ how to best decouple 2 classes that must maintain collections of references to each other
问题 I am looking for advice on the most elegant and secure way to decouple two C++ classes that maintain collections of pointers to each other's types. I implemented it recently using a common base class for polymorphism and was told that it was an unsatisfactory solution. I am eager to learn other ways this can be achieved. Thanks in advance... I have added a simplified version of the class definitions below. I am aware that the SalesTeam class is not decoupled from SalesPerson here. // Global