28 lines
576 B
C++
28 lines
576 B
C++
#pragma once
|
|
|
|
#include "validate_basic.h"
|
|
#include "dispatch.h"
|
|
|
|
namespace verify {
|
|
template<typename... Types> struct T;
|
|
|
|
template<typename Ret, typename... Args>
|
|
struct T<Ret(Args...)> {
|
|
template<Inlet::Callable<Ret, Args...> func>
|
|
struct Validate {
|
|
private:
|
|
validate::ValidateImpls<(void*)func, Ret, Args...> _helper;
|
|
|
|
public:
|
|
Validate() {
|
|
auto core = dispatch::Dispatch::unique();
|
|
core->setCmdValidator(_helper.address(), & _helper);
|
|
}
|
|
|
|
template<int n> validate::ArgsPosition<n, Args...> pos() {
|
|
return _helper.pos<n>();
|
|
}
|
|
};
|
|
};
|
|
}
|