src/basics.h

changeset 1123
15e46ea3151f
parent 1122
795d1c3554b9
child 1135
8e0691be0b6f
--- a/src/basics.h	Fri Feb 10 23:06:24 2017 +0200
+++ b/src/basics.h	Sun Feb 12 16:02:02 2017 +0200
@@ -197,7 +197,7 @@
 
 	Iterator end()
 	{
-		return Iterator(EnumLimits<Enum>::End);
+		return Iterator(EnumLimits<Enum>::Last + 1);
 	}
 };
 
@@ -209,9 +209,10 @@
 
 // Is a value inside an enum?
 template<typename Enum>
-bool valueInEnum(typename std::underlying_type<Enum>::type x)
+bool valueInEnum(Enum enumerator)
 {
-	return x >= EnumLimits<Enum>::First and x <= EnumLimits<Enum>::Last;
+	typename std::underlying_type<Enum>::type index = static_cast<typename std::underlying_type<Enum>::type>(enumerator);
+	return index >= EnumLimits<Enum>::First and index <= EnumLimits<Enum>::Last;
 }
 
 double getRadialPoint(int segment, int divisions, double(*func)(double));

mercurial