From fac01b10aab7903ad661bee008749b09cf57f33e Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 4 Mar 2019 12:45:02 +0100 Subject: [PATCH] Compare function key adjustement for Rule in Technology.h * Bug: In hurricane/Technology.h we define a set of UnitRule with a custom sorting function. STL starting with gcc 8, introduce a type checking of the compare function. And as everithon is template, we must use the exact key type and no longer a base type... So we create an overload for each derived type :-( --- hurricane/src/hurricane/hurricane/Technology.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hurricane/src/hurricane/hurricane/Technology.h b/hurricane/src/hurricane/hurricane/Technology.h index 9da35d69..7d1c1273 100644 --- a/hurricane/src/hurricane/hurricane/Technology.h +++ b/hurricane/src/hurricane/hurricane/Technology.h @@ -44,6 +44,9 @@ #include "hurricane/DeviceDescriptor.h" #include "hurricane/ModelDescriptor.h" #include "hurricane/Rule.h" +#include "hurricane/UnitRule.h" +#include "hurricane/PhysicalRule.h" +#include "hurricane/TwoLayersPhysicalRule.h" namespace Hurricane { @@ -55,9 +58,6 @@ namespace Hurricane { class BasicLayer; class RegularLayer; class ViaLayer; - class UnitRule; - class PhysicalRule; - class TwoLayersPhysicalRule; // ------------------------------------------------------------------- @@ -71,9 +71,12 @@ namespace Hurricane { typedef set DeviceDescriptors; typedef set ModelDescriptors; public: - struct RuleNameCompare: - public std::binary_function { - bool operator() ( const Rule* rule1, const Rule* rule2 ) const + struct RuleNameCompare { + inline bool operator() ( const PhysicalRule* rule1 , const PhysicalRule* rule2 ) const + { return rule1->getName() < rule2->getName(); } + inline bool operator() ( const UnitRule* rule1 , const UnitRule* rule2 ) const + { return rule1->getName() < rule2->getName(); } + inline bool operator() ( const Rule* rule1 , const Rule* rule2 ) const { return rule1->getName() < rule2->getName(); } }; public: