vendredi 27 juillet 2018

Automatize method calling c++

I am working on C++11 application. There I have a method which will be called many times(1000). That method accepts as parameters string and pointer to function.

The thing is that pointer to function will take different type of arguments, sometimes int, sometimes std:string and so on.

In order to avoid having 1000 different calls to my method I have thoguth of building a list of std::pairs with string and pointer to functions and iterating throught it to call my method.

But I have not found a clean way to achieve that.

Any ideas, please?

Thanks and regards

Aucun commentaire:

Enregistrer un commentaire