]> OCCT Git - occt.git/commitdiff
0033553: Foundation Classes - HashUtils compilation problem
authordpasukhi <dpasukhi@opencascade.com>
Thu, 14 Dec 2023 10:07:21 +0000 (10:07 +0000)
committervglukhik <vglukhik@opencascade.com>
Fri, 15 Dec 2023 19:52:56 +0000 (19:52 +0000)
Updated OptimalSeed template

src/Standard/Standard_HashUtils.hxx
src/TopLoc/TopLoc_Location.lxx

index 40b613fcab0a47ae8ffd245755f3287ee371055a..cee07037106d0a4e2192e1a4a4b76711fcb51bd5 100644 (file)
@@ -46,15 +46,9 @@ namespace opencascade
     }
 
     template <typename T = size_t>
-    constexpr typename std::enable_if<sizeof(T) == 8, uint64_t>::type optimalSeed()
+    constexpr T optimalSeed()
     {
-      return 0xA329F1D3A586ULL;
-    }
-
-    template <typename T = size_t>
-    constexpr typename std::enable_if<sizeof(T) != 8, T >::type optimalSeed()
-    {
-      return static_cast<T>(0xc70f6907U);
+      return sizeof(T) == 8 ? static_cast<T>(0xA329F1D3A586ULL) : static_cast<T>(0xc70f6907U);
     }
   };
 
@@ -84,15 +78,9 @@ namespace opencascade
     }
 
     template <typename T = size_t>
-    constexpr typename std::enable_if<sizeof(T) == 8, uint64_t>::type optimalSeed()
-    {
-      return 14695981039346656037ULL;
-    }
-
-    template <typename T = size_t>
-    constexpr typename std::enable_if<sizeof(T) != 8, T>::type optimalSeed()
+    constexpr T optimalSeed()
     {
-      return static_cast<T>(2166136261U);
+      return sizeof(T) == 8 ? static_cast<T>(14695981039346656037ULL) : static_cast<T>(2166136261U);
     }
   };
 
index f228dea0243a54140e9c7ee7363482a2259fdfd2..833632b439afec78830a7fdf70fda5fc4bfd34c1 100644 (file)
@@ -14,6 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#include <Standard_HashUtils.hxx>
 #include <TopLoc_SListOfItemLocation.hxx>
 #include <TopLoc_Datum3D.hxx>
 #include <TopLoc_ItemLocation.hxx>