Add a helper Impl() function for CRTP base 'Hash'

This commit is contained in:
hashlag
2025-08-10 22:40:40 +03:00
parent da4232894a
commit 36fa81abfd

View File

@@ -12,12 +12,23 @@ class Hash
public: public:
auto GetRawDigest() const auto GetRawDigest() const
{ {
return static_cast<const T &>(*this).GetRawDigest(); return Impl().GetRawDigest();
} }
std::string ToHexString() const std::string ToHexString() const
{ {
return static_cast<const T &>(*this).ToHexString(); return Impl().ToHexString();
}
private:
const T & Impl() const
{
return static_cast<const T &>(*this);
}
T & Impl()
{
return static_cast<T &>(*this);
} }
}; };