I am working on a C++ ROS Project, which contains different classes, each containing a vector.
The difficulty is that the vectors can be of different types. For example:
class A{
public
.....
private
std::vector<Class_C> List
}
class B{
public
.....
private
std::vector<Class_D> List
}
How could I achieve such task? I would like to find a way to simplify my code using templates, inheritances, and other language features.