jeudi 25 août 2022

Looping through all functions in a namespace in c++

My goal is to iterate over all functions of the namespace until a function returns me a valid strategy(enum). Each function can take different arguements.

enum class strategyType
{
    Strategy1,
    Strategy2,
    Strategy3,
    Strategy4,
    Strategy5,
    InvalidStrategy
}

namespace allFunctionStrategy
{
   strategyType algorithmMl(int v1,int v2);
   strategyType algorithmHeuristic(int v3,string s1);
   strategyType algorithmHeuristic(string s1,string s2);
   ... n such function's
}

class strategyContext
{
    int v1,v2,v3;
    string s1,s2;

/*i want to add iterator logic here*/
}

Aucun commentaire:

Enregistrer un commentaire