mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: simplify hashing to use struct instead of class
- more consistent with STL practices for function classes. - string::hash function class now operates on std::string rather than Foam::string since we have now avoided inadvertent use of string conversion from int in more places.
This commit is contained in:
@ -143,15 +143,14 @@ public:
|
||||
static const string null;
|
||||
|
||||
|
||||
//- Hashing function class, shared by all the derived classes
|
||||
class hash
|
||||
//- Hashing function for string and derived string classes
|
||||
struct hash
|
||||
{
|
||||
public:
|
||||
hash() = default;
|
||||
|
||||
//- Hash for string.
|
||||
// Uses Foam::string instead of std::string for automatic conversions.
|
||||
inline unsigned operator()(const string& str, unsigned seed = 0) const;
|
||||
inline unsigned operator()
|
||||
(
|
||||
const std::string& str,
|
||||
unsigned seed = 0
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -254,7 +254,7 @@ inline bool Foam::string::operator()(const std::string& text) const
|
||||
|
||||
inline unsigned Foam::string::hash::operator()
|
||||
(
|
||||
const string& str,
|
||||
const std::string& str,
|
||||
unsigned seed
|
||||
) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user