Explorar o código

fix problem with ifPresent and ifNotPresent functions of the maybe class

Kolja Strohm hai 1 mes
pai
achega
a9011d1dc1
Modificáronse 1 ficheiros con 8 adicións e 8 borrados
  1. 8 8
      Maybe.h

+ 8 - 8
Maybe.h

@@ -19,7 +19,7 @@ namespace Framework
 
         Maybe(T value)
             : set(1),
-              value(value){};
+              value(value) {};
 
     public:
         static Maybe<T> of(T value)
@@ -48,12 +48,12 @@ namespace Framework
             return value;
         }
 
-        void ifPresent(std::function<T> action)
+        void ifPresent(std::function<void(T)> action)
         {
             if (set) action(value);
         }
 
-        void ifNotPresent(std::function<T> action)
+        void ifNotPresent(std::function<void(T)> action)
         {
             if (!set) action(value);
         }
@@ -76,11 +76,11 @@ namespace Framework
 
         T orElse(T elseValue)
         {
-			if (set)
-				return value;
-			else
-				return elseValue;
-		}
+            if (set)
+                return value;
+            else
+                return elseValue;
+        }
 
         T operator->()
         {