mp: Generalize function information retrieval

Generalizes MemFnInfo to be compatible with all function types.
Also adds type introspection for arguments, as well as helper templates for the common types supported by all partial specializations.
This commit is contained in:
Lioncash 2016-08-16 12:40:04 -04:00 committed by MerryMage
parent 439619c827
commit 9ed9f4c565
6 changed files with 56 additions and 13 deletions

View file

@ -20,7 +20,7 @@ namespace Arm {
template <typename Visitor>
struct Thumb16Matcher {
using CallRetT = typename mp::MemFnInfo<decltype(&Visitor::thumb16_UDF)>::return_type;
using CallRetT = mp::return_type_t<decltype(&Visitor::thumb16_UDF)>;
Thumb16Matcher(const char* const name, u16 mask, u16 expect, std::function<CallRetT(Visitor&, u16)> fn)
: name(name), mask(mask), expect(expect), fn(fn) {}