diff --git a/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h b/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h index 1856e0d7820..1097ae67b2a 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h @@ -13,8 +13,8 @@ #ifndef LLVM_EXECUTIONENGINE_ORC_ORCRPCTARGETPROCESSCONTROL_H #define LLVM_EXECUTIONENGINE_ORC_ORCRPCTARGETPROCESSCONTROL_H -#include "llvm/ExecutionEngine/Orc/RPC/RPCUtils.h" -#include "llvm/ExecutionEngine/Orc/RPC/RawByteChannel.h" +#include "llvm/ExecutionEngine/Orc/Shared/RPCUtils.h" +#include "llvm/ExecutionEngine/Orc/Shared/RawByteChannel.h" #include "llvm/ExecutionEngine/Orc/TargetProcess/OrcRPCTPCServer.h" #include "llvm/ExecutionEngine/Orc/TargetProcessControl.h" #include "llvm/Support/MSVCErrorWorkarounds.h" diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h index dfed5e09e4d..3d139740d67 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h @@ -54,7 +54,7 @@ namespace remote { /// OrcRemoteTargetServer class) via an RPC system (see RPCUtils.h) to carry out /// its actions. class OrcRemoteTargetClient - : public rpc::SingleThreadedRPCEndpoint { + : public shared::SingleThreadedRPCEndpoint { public: /// Remote-mapped RuntimeDyld-compatible memory manager. class RemoteRTDyldMemoryManager : public RuntimeDyld::MemoryManager { @@ -703,7 +703,7 @@ public: /// Channel is the ChannelT instance to communicate on. It is assumed that /// the channel is ready to be read from and written to. static Expected> - Create(rpc::RawByteChannel &Channel, ExecutionSession &ES) { + Create(shared::RawByteChannel &Channel, ExecutionSession &ES) { Error Err = Error::success(); auto Client = std::unique_ptr( new OrcRemoteTargetClient(Channel, ES, Err)); @@ -805,9 +805,10 @@ public: Error terminateSession() { return callB(); } private: - OrcRemoteTargetClient(rpc::RawByteChannel &Channel, ExecutionSession &ES, + OrcRemoteTargetClient(shared::RawByteChannel &Channel, ExecutionSession &ES, Error &Err) - : rpc::SingleThreadedRPCEndpoint(Channel, true), + : shared::SingleThreadedRPCEndpoint(Channel, + true), ES(ES) { ErrorAsOutParameter EAO(&Err); diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h index 430ae2ca429..367bfb36919 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h @@ -16,8 +16,8 @@ #define LLVM_EXECUTIONENGINE_ORC_ORCREMOTETARGETRPCAPI_H #include "llvm/ExecutionEngine/JITSymbol.h" -#include "llvm/ExecutionEngine/Orc/RPC/RPCUtils.h" -#include "llvm/ExecutionEngine/Orc/RPC/RawByteChannel.h" +#include "llvm/ExecutionEngine/Orc/Shared/RPCUtils.h" +#include "llvm/ExecutionEngine/Orc/Shared/RawByteChannel.h" namespace llvm { namespace orc { @@ -73,10 +73,9 @@ private: } // end namespace remote -namespace rpc { +namespace shared { -template <> -class RPCTypeName { +template <> class SerializationTypeName { public: static const char *getName() { return "JITSymbolFlags"; } }; @@ -100,7 +99,7 @@ public: } }; -template <> class RPCTypeName { +template <> class SerializationTypeName { public: static const char *getName() { return "DirectBufferWriter"; } }; @@ -133,7 +132,7 @@ public: } }; -} // end namespace rpc +} // end namespace shared namespace remote { @@ -167,20 +166,20 @@ private: namespace eh { /// Registers EH frames on the remote. - class RegisterEHFrames - : public rpc::Function { - public: - static const char *getName() { return "RegisterEHFrames"; } - }; +class RegisterEHFrames + : public shared::RPCFunction { +public: + static const char *getName() { return "RegisterEHFrames"; } +}; /// Deregisters EH frames on the remote. - class DeregisterEHFrames - : public rpc::Function { - public: - static const char *getName() { return "DeregisterEHFrames"; } - }; +class DeregisterEHFrames + : public shared::RPCFunction { +public: + static const char *getName() { return "DeregisterEHFrames"; } +}; } // end namespace eh @@ -189,36 +188,38 @@ namespace exec { /// Call an 'int32_t()'-type function on the remote, returns the called /// function's return value. - class CallIntVoid - : public rpc::Function { - public: - static const char *getName() { return "CallIntVoid"; } - }; +class CallIntVoid + : public shared::RPCFunction { +public: + static const char *getName() { return "CallIntVoid"; } +}; /// Call an 'int32_t(int32_t)'-type function on the remote, returns the called /// function's return value. - class CallIntInt - : public rpc::Function { - public: - static const char *getName() { return "CallIntInt"; } - }; +class CallIntInt + : public shared::RPCFunction { +public: + static const char *getName() { return "CallIntInt"; } +}; /// Call an 'int32_t(int32_t, char**)'-type function on the remote, returns the /// called function's return value. - class CallMain - : public rpc::Function Args)> { - public: - static const char *getName() { return "CallMain"; } - }; +class CallMain + : public shared::RPCFunction Args)> { +public: + static const char *getName() { return "CallMain"; } +}; /// Calls a 'void()'-type function on the remote, returns when the called /// function completes. - class CallVoidVoid - : public rpc::Function { - public: - static const char *getName() { return "CallVoidVoid"; } - }; +class CallVoidVoid + : public shared::RPCFunction { +public: + static const char *getName() { return "CallVoidVoid"; } +}; } // end namespace exec @@ -226,60 +227,62 @@ namespace exec { namespace mem { /// Creates a memory allocator on the remote. - class CreateRemoteAllocator - : public rpc::Function { - public: - static const char *getName() { return "CreateRemoteAllocator"; } - }; +class CreateRemoteAllocator + : public shared::RPCFunction { +public: + static const char *getName() { return "CreateRemoteAllocator"; } +}; /// Destroys a remote allocator, freeing any memory allocated by it. - class DestroyRemoteAllocator - : public rpc::Function { - public: - static const char *getName() { return "DestroyRemoteAllocator"; } - }; +class DestroyRemoteAllocator + : public shared::RPCFunction { +public: + static const char *getName() { return "DestroyRemoteAllocator"; } +}; /// Read a remote memory block. - class ReadMem - : public rpc::Function(JITTargetAddress Src, - uint64_t Size)> { - public: - static const char *getName() { return "ReadMem"; } - }; +class ReadMem + : public shared::RPCFunction< + ReadMem, std::vector(JITTargetAddress Src, uint64_t Size)> { +public: + static const char *getName() { return "ReadMem"; } +}; /// Reserve a block of memory on the remote via the given allocator. - class ReserveMem - : public rpc::Function { - public: - static const char *getName() { return "ReserveMem"; } - }; +class ReserveMem + : public shared::RPCFunction< + ReserveMem, JITTargetAddress(ResourceIdMgr::ResourceId AllocID, + uint64_t Size, uint32_t Align)> { +public: + static const char *getName() { return "ReserveMem"; } +}; /// Set the memory protection on a memory block. - class SetProtections - : public rpc::Function { - public: - static const char *getName() { return "SetProtections"; } - }; +class SetProtections + : public shared::RPCFunction< + SetProtections, void(ResourceIdMgr::ResourceId AllocID, + JITTargetAddress Dst, uint32_t ProtFlags)> { +public: + static const char *getName() { return "SetProtections"; } +}; /// Write to a remote memory block. - class WriteMem - : public rpc::Function { - public: - static const char *getName() { return "WriteMem"; } - }; +class WriteMem + : public shared::RPCFunction { +public: + static const char *getName() { return "WriteMem"; } +}; /// Write to a remote pointer. - class WritePtr : public rpc::Function { - public: - static const char *getName() { return "WritePtr"; } - }; +class WritePtr + : public shared::RPCFunction { +public: + static const char *getName() { return "WritePtr"; } +}; } // end namespace mem @@ -287,45 +290,46 @@ namespace mem { namespace stubs { /// Creates an indirect stub owner on the remote. - class CreateIndirectStubsOwner - : public rpc::Function { - public: - static const char *getName() { return "CreateIndirectStubsOwner"; } - }; +class CreateIndirectStubsOwner + : public shared::RPCFunction { +public: + static const char *getName() { return "CreateIndirectStubsOwner"; } +}; /// RPC function for destroying an indirect stubs owner. - class DestroyIndirectStubsOwner - : public rpc::Function { - public: - static const char *getName() { return "DestroyIndirectStubsOwner"; } - }; +class DestroyIndirectStubsOwner + : public shared::RPCFunction { +public: + static const char *getName() { return "DestroyIndirectStubsOwner"; } +}; /// EmitIndirectStubs result is (StubsBase, PtrsBase, NumStubsEmitted). - class EmitIndirectStubs - : public rpc::Function< - EmitIndirectStubs, - std::tuple( - ResourceIdMgr::ResourceId StubsOwnerID, - uint32_t NumStubsRequired)> { - public: - static const char *getName() { return "EmitIndirectStubs"; } - }; +class EmitIndirectStubs + : public shared::RPCFunction< + EmitIndirectStubs, + std::tuple( + ResourceIdMgr::ResourceId StubsOwnerID, + uint32_t NumStubsRequired)> { +public: + static const char *getName() { return "EmitIndirectStubs"; } +}; /// RPC function to emit the resolver block and return its address. - class EmitResolverBlock : public rpc::Function { - public: - static const char *getName() { return "EmitResolverBlock"; } - }; +class EmitResolverBlock + : public shared::RPCFunction { +public: + static const char *getName() { return "EmitResolverBlock"; } +}; /// EmitTrampolineBlock result is (BlockAddr, NumTrampolines). - class EmitTrampolineBlock - : public rpc::Function()> { - public: - static const char *getName() { return "EmitTrampolineBlock"; } - }; +class EmitTrampolineBlock + : public shared::RPCFunction()> { +public: + static const char *getName() { return "EmitTrampolineBlock"; } +}; } // end namespace stubs @@ -334,44 +338,44 @@ namespace utils { /// GetRemoteInfo result is (Triple, PointerSize, PageSize, TrampolineSize, /// IndirectStubsSize). - class GetRemoteInfo - : public rpc::Function< - GetRemoteInfo, - std::tuple()> { - public: - static const char *getName() { return "GetRemoteInfo"; } - }; +class GetRemoteInfo + : public shared::RPCFunction< + GetRemoteInfo, + std::tuple()> { +public: + static const char *getName() { return "GetRemoteInfo"; } +}; /// Get the address of a remote symbol. - class GetSymbolAddress - : public rpc::Function { - public: - static const char *getName() { return "GetSymbolAddress"; } - }; +class GetSymbolAddress + : public shared::RPCFunction { +public: + static const char *getName() { return "GetSymbolAddress"; } +}; /// Request that the host execute a compile callback. - class RequestCompile - : public rpc::Function< - RequestCompile, JITTargetAddress(JITTargetAddress TrampolineAddr)> { - public: - static const char *getName() { return "RequestCompile"; } - }; +class RequestCompile + : public shared::RPCFunction< + RequestCompile, JITTargetAddress(JITTargetAddress TrampolineAddr)> { +public: + static const char *getName() { return "RequestCompile"; } +}; /// Notify the remote and terminate the session. - class TerminateSession : public rpc::Function { - public: - static const char *getName() { return "TerminateSession"; } - }; +class TerminateSession : public shared::RPCFunction { +public: + static const char *getName() { return "TerminateSession"; } +}; } // namespace utils class OrcRemoteTargetRPCAPI - : public rpc::SingleThreadedRPCEndpoint { + : public shared::SingleThreadedRPCEndpoint { public: // FIXME: Remove constructors once MSVC supports synthesizing move-ops. - OrcRemoteTargetRPCAPI(rpc::RawByteChannel &C) - : rpc::SingleThreadedRPCEndpoint(C, true) {} + OrcRemoteTargetRPCAPI(shared::RawByteChannel &C) + : shared::SingleThreadedRPCEndpoint(C, true) {} }; } // end namespace remote diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h index 562e38d6ef0..68eccf44cc7 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h @@ -46,7 +46,7 @@ namespace remote { template class OrcRemoteTargetServer - : public rpc::SingleThreadedRPCEndpoint { + : public shared::SingleThreadedRPCEndpoint { public: using SymbolLookupFtor = std::function; @@ -57,7 +57,8 @@ public: OrcRemoteTargetServer(ChannelT &Channel, SymbolLookupFtor SymbolLookup, EHFrameRegistrationFtor EHFramesRegister, EHFrameRegistrationFtor EHFramesDeregister) - : rpc::SingleThreadedRPCEndpoint(Channel, true), + : shared::SingleThreadedRPCEndpoint(Channel, + true), SymbolLookup(std::move(SymbolLookup)), EHFramesRegister(std::move(EHFramesRegister)), EHFramesDeregister(std::move(EHFramesDeregister)) { diff --git a/include/llvm/ExecutionEngine/Orc/RPC/FDRawByteChannel.h b/include/llvm/ExecutionEngine/Orc/Shared/FDRawByteChannel.h similarity index 87% rename from include/llvm/ExecutionEngine/Orc/RPC/FDRawByteChannel.h rename to include/llvm/ExecutionEngine/Orc/Shared/FDRawByteChannel.h index 9faa1afe546..f90b71db108 100644 --- a/include/llvm/ExecutionEngine/Orc/RPC/FDRawByteChannel.h +++ b/include/llvm/ExecutionEngine/Orc/Shared/FDRawByteChannel.h @@ -10,10 +10,10 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_EXECUTIONENGINE_ORC_RPC_FDRAWBYTECHANNEL_H -#define LLVM_EXECUTIONENGINE_ORC_RPC_FDRAWBYTECHANNEL_H +#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_FDRAWBYTECHANNEL_H +#define LLVM_EXECUTIONENGINE_ORC_SHARED_FDRAWBYTECHANNEL_H -#include "llvm/ExecutionEngine/Orc/RPC/RawByteChannel.h" +#include "llvm/ExecutionEngine/Orc/Shared/RawByteChannel.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/raw_ostream.h" @@ -26,9 +26,9 @@ namespace llvm { namespace orc { -namespace rpc { +namespace shared { -/// RPC channel that reads from and writes from file descriptors. +/// Serialization channel that reads from and writes from file descriptors. class FDRawByteChannel final : public RawByteChannel { public: FDRawByteChannel(int InFD, int OutFD) : InFD(InFD), OutFD(OutFD) {} @@ -85,8 +85,8 @@ private: int InFD, OutFD; }; -} // namespace rpc +} // namespace shared } // namespace orc } // namespace llvm -#endif // LLVM_EXECUTIONENGINE_ORC_RPC_FDRAWBYTECHANNEL_H +#endif // LLVM_EXECUTIONENGINE_ORC_SHARED_FDRAWBYTECHANNEL_H diff --git a/include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h b/include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h similarity index 89% rename from include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h rename to include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h index 306a5eeec38..1c8b8e0bc92 100644 --- a/include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h +++ b/include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h @@ -14,8 +14,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_EXECUTIONENGINE_ORC_RPC_RPCUTILS_H -#define LLVM_EXECUTIONENGINE_ORC_RPC_RPCUTILS_H +#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_RPCUTILS_H +#define LLVM_EXECUTIONENGINE_ORC_SHARED_RPCUTILS_H #include #include @@ -23,14 +23,14 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/Orc/OrcError.h" -#include "llvm/ExecutionEngine/Orc/RPC/RPCSerialization.h" +#include "llvm/ExecutionEngine/Orc/Shared/Serialization.h" #include "llvm/Support/MSVCErrorWorkarounds.h" #include namespace llvm { namespace orc { -namespace rpc { +namespace shared { /// Base class of all fatal RPC errors (those that necessarily result in the /// termination of the RPC session). @@ -56,7 +56,7 @@ public: /// function id it cannot parse the call. template class BadFunctionCall - : public ErrorInfo, RPCFatalError> { + : public ErrorInfo, RPCFatalError> { public: static char ID; @@ -68,8 +68,10 @@ public: } void log(raw_ostream &OS) const override { - OS << "Call to invalid RPC function id '" << FnId << "' with " - "sequence number " << SeqNo; + OS << "Call to invalid RPC function id '" << FnId + << "' with " + "sequence number " + << SeqNo; } private: @@ -89,12 +91,12 @@ char BadFunctionCall::ID = 0; /// a result parser for this sequence number it can't do that. template class InvalidSequenceNumberForResponse - : public ErrorInfo, RPCFatalError> { + : public ErrorInfo, + RPCFatalError> { public: static char ID; - InvalidSequenceNumberForResponse(SeqNoT SeqNo) - : SeqNo(std::move(SeqNo)) {} + InvalidSequenceNumberForResponse(SeqNoT SeqNo) : SeqNo(std::move(SeqNo)) {} std::error_code convertToErrorCode() const override { return orcError(OrcErrorCode::UnexpectedRPCCall); @@ -103,6 +105,7 @@ public: void log(raw_ostream &OS) const override { OS << "Response has unknown sequence number " << SeqNo; } + private: SeqNoT SeqNo; }; @@ -131,17 +134,18 @@ public: std::error_code convertToErrorCode() const override; void log(raw_ostream &OS) const override; const std::string &getSignature() const { return Signature; } + private: std::string Signature; }; -template class Function; +template class RPCFunction; // RPC Function class. // DerivedFunc should be a user defined class with a static 'getName()' method // returning a const char* representing the function's name. template -class Function { +class RPCFunction { public: /// User defined function type. using Type = RetT(ArgTs...); @@ -154,8 +158,9 @@ public: static std::string Name = [] { std::string Name; raw_string_ostream(Name) - << RPCTypeName::getName() << " " << DerivedFunc::getName() - << "(" << llvm::orc::rpc::RPCTypeNameSequence() << ")"; + << SerializationTypeName::getName() << " " + << DerivedFunc::getName() << "(" + << SerializationTypeNameSequence() << ")"; return Name; }(); return Name.data(); @@ -199,10 +204,10 @@ private: namespace detail { /// Provides a typedef for a tuple containing the decayed argument types. -template class FunctionArgsTuple; +template class RPCFunctionArgsTuple; template -class FunctionArgsTuple { +class RPCFunctionArgsTuple { public: using Type = std::tuple>...>; }; @@ -287,34 +292,28 @@ class ResultTraits> : public ResultTraits {}; // Determines whether an RPC function's defined error return type supports // error return value. -template -class SupportsErrorReturn { +template class SupportsErrorReturn { public: static const bool value = false; }; -template <> -class SupportsErrorReturn { +template <> class SupportsErrorReturn { public: static const bool value = true; }; -template -class SupportsErrorReturn> { +template class SupportsErrorReturn> { public: static const bool value = true; }; // RespondHelper packages return values based on whether or not the declared // RPC function return type supports error returns. -template -class RespondHelper; +template class RespondHelper; // RespondHelper specialization for functions that support error returns. -template <> -class RespondHelper { +template <> class RespondHelper { public: - // Send Expected. template @@ -330,9 +329,8 @@ public: // Serialize the result. if (auto Err = - SerializationTraits>::serialize( - C, std::move(ResultOrErr))) + SerializationTraits>:: + serialize(C, std::move(ResultOrErr))) return Err; // Close the response message. @@ -354,14 +352,11 @@ public: return Err2; return C.send(); } - }; // RespondHelper specialization for functions that do not support error returns. -template <> -class RespondHelper { +template <> class RespondHelper { public: - template static Error sendResult(ChannelT &C, const FunctionIdT &ResponseId, @@ -376,8 +371,8 @@ public: // Serialize the result. if (auto Err = - SerializationTraits::serialize( - C, *ResultOrErr)) + SerializationTraits::serialize( + C, *ResultOrErr)) return Err; // End the response message. @@ -398,18 +393,17 @@ public: return Err2; return C.send(); } - }; - // Send a response of the given wire return type (WireRetT) over the // channel, with the given sequence number. template -Error respond(ChannelT &C, const FunctionIdT &ResponseId, - SequenceNumberT SeqNo, Expected ResultOrErr) { +Error respond(ChannelT &C, const FunctionIdT &ResponseId, SequenceNumberT SeqNo, + Expected ResultOrErr) { return RespondHelper::value>:: - template sendResult(C, ResponseId, SeqNo, std::move(ResultOrErr)); + template sendResult(C, ResponseId, SeqNo, + std::move(ResultOrErr)); } // Send an empty response message on the given channel to indicate that @@ -418,8 +412,8 @@ template Error respond(ChannelT &C, const FunctionIdT &ResponseId, SequenceNumberT SeqNo, Error Err) { - return RespondHelper::value>:: - sendResult(C, ResponseId, SeqNo, std::move(Err)); + return RespondHelper::value>::sendResult( + C, ResponseId, SeqNo, std::move(Err)); } // Converts a given type to the equivalent error return type. @@ -453,7 +447,8 @@ public: template class AsyncHandlerTraits; template -class AsyncHandlerTraits)>, ArgTs...)> { +class AsyncHandlerTraits)>, + ArgTs...)> { public: using Type = Error(ArgTs...); using ResultType = Expected; @@ -490,9 +485,9 @@ class AsyncHandlerTraits // specialized for function types) and inherits from the appropriate // speciilization for the given non-function type's call operator. template -class HandlerTraits : public HandlerTraits::type::operator())> { -}; +class HandlerTraits + : public HandlerTraits< + decltype(&std::remove_reference::type::operator())> {}; // Traits for handlers with a given function type. template @@ -524,7 +519,7 @@ public: template static std::enable_if_t< std::is_void::ReturnType>::value, Error> - run(HandlerT &Handler, ArgTs &&... Args) { + run(HandlerT &Handler, ArgTs &&...Args) { Handler(std::move(Args)...); return Error::success(); } @@ -577,8 +572,8 @@ private: // Handler traits for free functions. template -class HandlerTraits - : public HandlerTraits {}; +class HandlerTraits : public HandlerTraits { +}; // Handler traits for class methods (especially call operators for lambdas). template @@ -714,9 +709,8 @@ public: typename HandlerTraits::Type>::ArgType; HandlerArgType Result((typename HandlerArgType::value_type())); - if (auto Err = - SerializationTraits, - HandlerArgType>::deserialize(C, Result)) + if (auto Err = SerializationTraits, + HandlerArgType>::deserialize(C, Result)) return Err; if (auto Err = C.endReceiveMessage()) return Err; @@ -786,7 +780,7 @@ public: using MethodT = RetT (ClassT::*)(ArgTs...); MemberFnWrapper(ClassT &Instance, MethodT Method) : Instance(Instance), Method(Method) {} - RetT operator()(ArgTs &&... Args) { + RetT operator()(ArgTs &&...Args) { return (Instance.*Method)(std::move(Args)...); } @@ -804,10 +798,9 @@ public: template class ReadArgs : public ReadArgs { public: - ReadArgs(ArgT &Arg, ArgTs &... Args) - : ReadArgs(Args...), Arg(Arg) {} + ReadArgs(ArgT &Arg, ArgTs &...Args) : ReadArgs(Args...), Arg(Arg) {} - Error operator()(ArgT &ArgVal, ArgTs &... ArgVals) { + Error operator()(ArgT &ArgVal, ArgTs &...ArgVals) { this->Arg = std::move(ArgVal); return ReadArgs::operator()(ArgVals...); } @@ -872,8 +865,8 @@ public: template