rpcsx/rpcsx-gpu/lib/gcn-shader/include/shader/ir/PrintableWrapper.hpp

27 lines
609 B
C++
Raw Normal View History

2024-09-25 15:00:55 +02:00
#pragma once
#include "PointerWrapper.hpp"
#include <ostream>
namespace shader::ir {
class NameStorage;
template <typename T> struct PrintableWrapper : PointerWrapper<T> {
using PointerWrapper<T>::PointerWrapper;
using PointerWrapper<T>::operator=;
void print(std::ostream &os, NameStorage &ns) const {
if constexpr (requires { this->impl->print(os, ns); }) {
this->impl->print(os, ns);
} else {
this->impl->print(os);
}
}
void print(std::ostream &os) const
requires requires { this->impl->print(os); }
{
this->impl->print(os);
}
};
} // namespace shader::ir