1212template <class T , class D >
1313class Problem
1414{
15+ /* * Typedefs for handling pointer-to-function **/
16+ typedef void (Problem::*ProblemVoidFn)();
17+ typedef D (Problem::*ProblemDataFn)();
18+ typedef bool (Problem::*ProblemBoolFn)();
19+
1520public:
1621 // Problem<T,D>(std::string fileName);
1722 Problem<T,D>(std::string fileName, int size);
@@ -23,7 +28,7 @@ class Problem
2328 // Setters
2429 void setReadInput (D (*functionPointer)());
2530 void setInitStack (void (*functionPointer)());
26- void setPopCondition (bool (* functionPointer)() );
31+ void setPopCondition (ProblemBoolFn functionPointer);
2732 void setPopAction (void (*functionPointer)());
2833 void setPushCondition (bool (*functionPointer)());
2934 void setPushAction (void (*functionPointer)());
@@ -151,7 +156,7 @@ void Problem<T,D>::setPopAction(void (*functionPointer)()){
151156 mPopAction = functionPointer;
152157}
153158template <class T , class D >
154- void Problem<T,D>::setPopCondition(bool (* functionPointer)() ){
159+ void Problem<T,D>::setPopCondition(ProblemBoolFn functionPointer){
155160 mPopConditon = functionPointer;
156161}
157162template <class T , class D >
0 commit comments