8template<
typename C,
typename M>
20template<auto* Function, auto MockFunction>
33 template<
typename... Args>
39 if (
sMock !=
nullptr) {
40 throw std::runtime_error(
"Trampoline already in use");
62 void CheckOwnership() {
63 if (
sMock != &mMock) {
64 throw std::runtime_error(
"Trampoline not owned by this instance");
69 static_assert(std::is_member_function_pointer_v<MockFunctionType>);
70 static_assert(std::is_function_v<std::remove_pointer_t<FunctionPtrType>>);
Trampoline(MockType *mock)
decltype(Function) FunctionLocationType
decltype(MockFunction) MockFunctionType
static constexpr MockFunctionType mockFunc
static auto trampolineImpl(Args... args) -> decltype((std::declval< MockType * >() -> *mockFunc)(args...))
std::remove_pointer_t< FunctionLocationType > FunctionPtrType
static FunctionPtrType realFunc
member_pointer_class_t< MockFunctionType > MockType
static FunctionLocationType func
typename member_pointer_class< T >::type member_pointer_class_t