No, this isn't directly possible because list
s with different template types are completely unrelated containers.
If you know that all the items in list1
are actually the child class A
then just make list1
contain them as such up front. If you don't know that they're all of the child class then the conversion you want to do is illegal.
What are you really trying to do here?