Files
chaos/Chaos/Padding/Padder.hpp
hashlag 797a5428cc
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 1m59s
Add Padder<>. A CRTP base for padding algorithms.
2026-02-08 23:44:51 +03:00

35 lines
533 B
C++

#ifndef CHAOS_PADDING_PADDER_HPP
#define CHAOS_PADDING_PADDER_HPP
namespace Chaos::Padding
{
template<typename T>
class Padder
{
public:
template<typename OutputIt>
void Pad(OutputIt begin, OutputIt end) const
{
Impl().Pad(begin, end);
}
protected:
Padder() = default;
private:
const T & Impl() const
{
return static_cast<const T &>(*this);
}
T & Impl()
{
return static_cast<T &>(*this);
}
};
} // namespace Chaos::Padding
#endif // CHAOS_PADDING_PADDER_HPP