Val - 2014-01-24

Hi all.

Firstly, I apologize for my english ;)
I'm trying to call overriden methods with a boost::variant stored in a vector, without specifying the real type of the stored data.
Concretely, I'm trying to write something looks like : (sorry, didn't found the C++ code formatting)

typedef boost::variant\<int, MyClass*> myType;
std::vector<myType> myVector;

void push(int i) {

void push(MyClass* ptr) {


without specifying the real type of myVector[0] when calling one of the push() functions.
Is there any way to do this or should I use virtual class ?

Thank you all :)

Last edit: Val 2014-01-24