vendredi 2 octobre 2020

c++ how to pass min() and max() as as constructor argument?

I have a class MyClass, which will use either min() or max() based on what argument is taken during construction,

class MyClass {
private:
    myfunc;
public:
    MyClass(args);
}

Later myfunc will be used in another method in MyClass, and I would like args can be used to initialize myfunc to be either max or min, wondering how to achieve that? or maybe other way I can set myfunc to be either max or min will be fine too.

Aucun commentaire:

Enregistrer un commentaire