Add no-trait base OpImpl::Base.

PiperOrigin-RevId: 204915682
This commit is contained in:
Jacques Pienaar 2018-07-17 08:33:07 -07:00 committed by jpienaar
parent fc7d6dbe5e
commit 4293666bf7
1 changed files with 11 additions and 1 deletions

View File

@ -116,8 +116,11 @@ protected:
: state(const_cast<Operation *>(state)) {}
private:
template <typename... Types>
struct BaseVerifier;
template <typename First, typename... Rest>
struct BaseVerifier {
struct BaseVerifier<First, Rest...> {
static const char *verifyBase(const Operation *op) {
if (auto error = First::verifyBase(op))
return error;
@ -132,6 +135,13 @@ private:
}
};
template <>
struct BaseVerifier<> {
static const char *verifyBase(const Operation *op) {
return nullptr;
}
};
Operation *state;
};