Possibility to handle class method & example
[command.git] / include / option.h
index 7e9917b589c7021a0c5852695e90eecb5fa36908..d9630a798b486bed5225e802d09c519e85c4ef4c 100644 (file)
@@ -44,7 +44,7 @@ namespace command {
          * @param description Description of current Option
          * @param function Function used to handle current Option.
          */
-        Option(const std::string & name, const std::string & description, void (*function)(ParameterType))
+        Option(const std::string & name, const std::string & description, std::function<void(ParameterType)> function)
             : Parameter(description), Callable<ParameterType>(function), name(name) {
         }
 
@@ -158,7 +158,7 @@ namespace command {
          * @param description Description of current Option
          * @param function Function used to handle current Option.
          */
-        Option(const std::string & name, const std::string & description, void (*function)(void))
+        Option(const std::string & name, const std::string & description, std::function<void(void)> function)
             : Parameter(description), Callable<void>(function), name(name) {
         }