GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / Hashable.cpp
blob547a3065f6492581b157fe654140f41639849e14
1 #include "ace/Hashable.h"
3 #if !defined (__ACE_INLINE__)
4 #include "ace/Hashable.inl"
5 #endif /* __ACE_INLINE __ */
7 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
9 ACE_Hashable::~ACE_Hashable (void)
13 unsigned long
14 ACE_Hashable::hash (void) const
16 // In doing the check below, we take chance of paying a performance
17 // price when the hash value is zero. But, that will (hopefully)
18 // happen far less often than a non-zero value, so this caching
19 // strategy should pay off, esp. if hash computation is expensive
20 // relative to the simple comparison.
22 if (this->hash_value_ == 0)
23 this->hash_value_ = this->hash_i ();
25 return this->hash_value_;
28 ACE_END_VERSIONED_NAMESPACE_DECL