ENH: simplify hashing overloads of string-types

- this revises the changes made in 95cd8ee75c to replace the
  SFINAE-type of handling of string hashes with direct definitions.

  This places a bit more burden on the developer if creating hashable
  classes derived from std::string or variants of Foam::string, but
  improves reliability when linking.

STYLE: drop template key defaulting from HashSet

- this was never used and `HashSet<>` is much less transparent
  than writing `HashSet<word>` or `wordHashSet`
This commit is contained in:
Mark Olesen
2021-12-03 12:51:31 +01:00
parent 939c335504
commit bdf77bbdd1
11 changed files with 116 additions and 66 deletions

View File

@ -106,6 +106,15 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace ensight
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Hashing for FileName is the same as string
template<> struct Hash<ensight::FileName> : string::hasher {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -104,6 +104,16 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace ensight
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Hashing for VarName is the same as string
template<> struct Hash<ensight::VarName> : string::hasher {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //