Make CRTP base classes ctors protected
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 1m39s

This forbids to create base class instances which direct usage could lead to UB.
This commit is contained in:
hashlag
2026-01-30 00:44:24 +03:00
parent 2c9200ab21
commit b5d1f9a6fc
2 changed files with 6 additions and 0 deletions

View File

@@ -20,6 +20,9 @@ public:
return Impl().ToHexString(); return Impl().ToHexString();
} }
protected:
Hash() = default;
private: private:
const T & Impl() const const T & Impl() const
{ {

View File

@@ -24,6 +24,9 @@ public:
return Impl().Finish(); return Impl().Finish();
} }
protected:
Hasher() = default;
private: private:
const T & Impl() const const T & Impl() const
{ {