I have to have a semantic stack in my project which is going to hold multiple types in it.
I aim to have my project to use modern C++.
What is the correct way to have a stack of any type ?
Equivalent version in java is Stack<Object>
.
Which of these are correct?
- Use
void*
and cast it to the type I want. - Something as 1 but using some smart pointers. (I don't know what)
Aucun commentaire:
Enregistrer un commentaire