Add a helper Impl() function for CRTP base 'Hash'
This commit is contained in:
@@ -12,12 +12,23 @@ class Hash
|
||||
public:
|
||||
auto GetRawDigest() const
|
||||
{
|
||||
return static_cast<const T &>(*this).GetRawDigest();
|
||||
return Impl().GetRawDigest();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user