Browse Source

Fix compiler warnings about Optional field initialization order

Alex Szpakowski 6 years ago
parent
commit
3938da9cc6
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/common/Optional.h

+ 5 - 5
src/common/Optional.h

@@ -31,19 +31,19 @@ struct Optional
 	bool hasValue;
 	bool hasValue;
 
 
 	Optional()
 	Optional()
-		: hasValue(false)
-		, value(T())
+		: value(T())
+		, hasValue(false)
 	{}
 	{}
 
 
 	Optional(T val)
 	Optional(T val)
-		: hasValue(true)
-		, value(val)
+		: value(val)
+		, hasValue(true)
 	{}
 	{}
 
 
 	void set(T val)
 	void set(T val)
 	{
 	{
-		hasValue = true;
 		value = val;
 		value = val;
+		hasValue = true;
 	}
 	}
 };
 };