Quellcode durchsuchen

Specialize std::hash for GpuProgramProfile

Marc Legendre vor 9 Jahren
Ursprung
Commit
410359d73f
1 geänderte Dateien mit 16 neuen und 1 gelöschten Zeilen
  1. 16 1
      Source/BansheeCore/Include/BsGpuProgram.h

+ 16 - 1
Source/BansheeCore/Include/BsGpuProgram.h

@@ -231,4 +231,19 @@ namespace BansheeEngine
 	};
 	};
 
 
 	/** @} */
 	/** @} */
-}
+}
+
+namespace std
+{
+/** Hash value generator for GpuProgramProfile. */
+template<>
+struct hash<BansheeEngine::GpuProgramProfile>
+{
+	size_t operator()(const BansheeEngine::GpuProgramProfile& profile) const
+	{
+		size_t hash = 0;
+		BansheeEngine::hash_combine(hash, (int)profile);
+		return hash;
+	}
+};
+}