Possibility to pass class method reference
[command.git] / tests / callable / TestCallable.h
index 097e115b9acbee7be45c051ab92c432e2d91b998..a4185c52bde0bac6df2587dde4bc067142f58930 100644 (file)
@@ -9,7 +9,27 @@ public:
         : Callable<ArgumentType>(function) {
     }
 
+    TestCallable(std::function<void(ArgumentType)> function)
+        : Callable<ArgumentType>(function) {
+    }
+
     void callFunction(ArgumentType test) {
         this->call(test);
     }
 };
+
+template<>
+class TestCallable<void> : public Callable<void> {
+public:
+    TestCallable(void (*function)(void))
+        : Callable<void>(function) {
+    }
+
+    TestCallable(std::function<void(void)> function)
+        : Callable<void>(function) {
+    }
+
+    void callFunction() {
+        this->call();
+    }
+};